Thursday, October 29, 2015 7:58 PM

Python If-else expression (Activity 4.2.3)


PythonQuestion:
Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive). 

Code:
 user_grade = 10
if 9<=user_grade<=12:
    print('in high school')
else:
    print('not in high school')

About Unknown

Here you can share some biographical information next to your profile photo. Let your readers know your interests and accomplishments.

No comments:

Post a Comment