Ask your own question, for FREE!
Computer Science 8 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!
Latest Questions
Arriyanalol: i need help
2 days ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
2 days ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
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!