<div>I will use simple function:</div>
<div> </div>
<div>def getscore(val):<br> if 90 < val <=100:<br> return 'A'<br> elif val >= 80:<br> return 'B'<br> elif val >= 70:<br> return 'C'<br> elif val >= 60:<br> return 'D'
<br> else:<br> return 'F'<br> <br>def main():<br> g = input('Enter score:')<br> print 'the score of the exam is %s' % (getscore(int(g)))<br><br>Cheers,</div>
<div>pujo<br> </div>
<div><span class="gmail_quote">On 9/25/05, <b class="gmail_sendername"><a href="mailto:Goofball223@wmconnect.com">Goofball223@wmconnect.com</a></b> <<a href="mailto:Goofball223@wmconnect.com">Goofball223@wmconnect.com
</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><font face="arial,helvetica"><font size="2">Hello <br><br>How would I get the following program to accept inputs of exam scores from 0-100 with A being 100-90, B being 89-80, C being 79-70, D being 69-60, and F being everything less than 60?
<br><br>import string <br><br>def main(): <br><br><br> scores = ["F", "D", "C", "B", "A"] <br> g = input("Enter a score number (0-100): ") <br><br> print "The score of your exam is", scores [g-0] + "."
<br><br><br>main() </font> </font><br>_______________________________________________<br>Tutor maillist - <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Tutor@python.org">Tutor@python.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br><br><br></blockquote></div><br>