Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (anonymous):

Error in code...

OpenStudy (anonymous):

I keep on getting an error for this code: def order(s): """precondition: s is a single alpha character, lower or upper case postcondition: returns s's position in the alphabet. See the test code below """ alpha = "abcdefghijklmnopqrstuvwxyz" s = s.lower() int(s) = s.find(alpha) return x + 1 what is wrong? thx, i'm new at python

OpenStudy (rsmith6559):

return x + 1 Where is x declared/initialized? For debugging, I usually put print statements in to see what the variables have at each step.

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!