A community for students.
Here's the question you clicked on:
 0 viewing
anonymous
 5 years ago
Problem Set 2, #3
anonymous
 5 years ago
Problem Set 2, #3

This Question is Closed

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0for some reason it isnt working, when launched it just remains a blank screen

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0I just did it this morning. I'll take a look at it.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0The only I see wrong right off the back is you never assigned in in your test statement to fix that you can add 1 argument to your test function which would be n. I'm going to try it now and tell you if it works.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0You also didn't assign count in test(). I don't understand what you were trying to do with count in test I don't think those do anything

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0ok wait let me upload my most recent one

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0ok sorry some indentation issues...heres the most recent one, it just returns 5

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0ok still in test you are not giving it an argument therefore n is not assigned inside the function test(). Your argument should be test(n).

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0ok now it just returns 5 once...i guess thats an improvement

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0In your test function the body of your else statement should be even with "for a in range(0,n)" because the way yours is setup it will only check the first possible solution in stead of all solutions in (0,n) and would you rather me explain everything or post a fixed code.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0can you please post a fixed code then if i have any questions ill ask you?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Yea one sec lemme do it really quick.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0and i know some people use tuples or lists on this problem, thats not needed right?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0No it can be done either way http://dpaste.com/hold/529001/

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Do you want to see it done with a list?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0no thanks, i havent tried it yet so i'd rather attempt on my own but thanks for all the help!

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0so basically i just had to get rid of the else statement because it was causing it to check for only one value?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0you had to add the argument to test which was test(n). I deleted the print n5 in test there was no point to it. Your return n5 should only be return n. I also deleted your n=0 its outside the function and isn't doing anything.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0sorry I forgot to comment out the wrong stuff instead of deleting it.

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0its fine i understood it all, main thing was deleting the else statement...but why exactly do i need an arguement for test?

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0try it without the arguments you get a name error because functions have local variables. so unless you tell it to take an argument none of the variables you are already using will carry over. Therefor the n in cheese() will not moved to test() unless you tell it to by putting test(n).

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0thanks btw im 16 so we are the young ones of this school lolz

anonymous
 5 years ago
Best ResponseYou've already chosen the best response.0Yeah, no problem and thats cool haha I'll be 16 in June.
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.