Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # P2PU - Python Programming 101 - Chapter 6 - Flow Control
- # Python for Informatics - Chapter 3 - Conditional Execution
- # Exercise 3.3
- print '\n# Exercise 3.3\n'
- try:
- num = float(raw_input('Enter a number between 0.0 and 1.0: '))
- if num < 0.0 or num > 1.0 : print 'Bad score!'
- elif num >= 0.9 : print 'A'
- elif num >= 0.8 : print 'B'
- elif num >= 0.7 : print 'C'
- elif num >= 0.6 : print 'D'
- else : print 'F'
- except:
- print 'Bad score!'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement