Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 18 Online
OpenStudy (anonymous):

http://pastebin.com/3vbPiG7G quick questions about passing variables to functions. Is there a way to directly pass the value of what is input or at least something to make this work without all these scrubby looking if statements?

OpenStudy (anonymous):

From the code you pasted, it looks like your are on ps3 problem 1. Instead of using a counter, you can append the "found" locations to a list and rerun the length of the list.

OpenStudy (anonymous):

also you should use elif instead of ifs, because if it finds correct key it still checks, but it's not necessary

OpenStudy (anonymous):

also next time upload code with language syntax :)

OpenStudy (anonymous):

try eval() http://pastebin.com/q3ExXTQp

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!