EOSERV Forum > Programming > Python Help
Topic is locked.
Page: << 1 >>
Python Help
Author Message
Post #135389 Python Help

I can't find anything that is wrong with it. It keep echoing A even though its lower than the 90 score.


Code:

http://pastebin.com/bqPS4sPv


Image of fail:

Image is kinda big for the failness so I'm just going to post the link instead of inserting the image.

http://i497.photobucket.com/albums/rr335/timvault/pythonerror.png

---
http://www.torn.com/478456
14 years, 16 weeks ago
Post #135439 Re: Python Help

Several Mistakes:

Raw_input is for strings, not integers so just use input. (not sure might be mixed up with java, still try just input)

Try using:

number = input("what did you get on the test?")

if number >= 90:

print 'A'

elif number <= 89 and number >= 80:

print 'B'

elif number <= 79 and number >= 70:

print 'C'

elif number <= 69 and number >= 60:

print 'D'

else number <= 59:

print 'F'



Hopefully that works (I moved on from python to java and its kinda confusing to differentiate between them.)

You're problem was that you're Boolean statement was checking if the variable is equal to whatever you said it was so youwould never get any results.


---
EOServ Class: Main Player, Mapping Artist, Oldbie
14 years, 16 weeks ago
Post #135473 Re: Python Help

thanks a lot it works. found the == mistake right after posting that.

---
http://www.torn.com/478456
14 years, 16 weeks ago
Post #135636 Re: Python Help
dedwcdustin posted: (6th Mar 2012, 09:59 am)

thanks a lot it works. found the == mistake right after posting that.


glad I could help :)
---
EOServ Class: Main Player, Mapping Artist, Oldbie
14 years, 16 weeks ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > Programming > Python Help