Select to view content in your preferred language

http://forums.arcgis.com/threads/113250-JetBrains-PyCharm-Community-Edition-3.1.3

488
1
06-18-2014 06:25 AM
MikePettrucci
New Contributor
Need Help with the following problem please:

Write a Python program that accomplishes the following task:

1. Prompt the user for their numerical grade.

2. Based on that numerical grade, print the letter grade that corresponds to it.  Use an if/elif/else construct to determine the proper letter grade.

If <condition>
    print("Your letter grade is an A")
elif <condition>
    print("Your letter grade is an B")
elif <condition>
    print("Your letter grade is an C")
else
    print("Your letter grade is an F")
---------------------------------------- which will ask for the me to input the grade but when hit enter getting error on  (if grade > 90:) line 6 and so far this is what I got:

grade = input ('enter grade:')

if grade > 90:
    print ('Your letter grade is an A')

elif grade > 80:
    print('Your letter grade is an B')

elif grade > 70:
    print('Your letter grade is an C')

else:
    print('Your letter grade is an F')

JetBrains PyCharm Community Edition 3.1.3

    Need Help with the following problem please:

    Write a Python program that accomplishes the following task:

    1. Prompt the user for their numerical grade.

    2. Based on that numerical grade, print the letter grade that corresponds to it. Use an if/elif/else construct to determine the proper letter grade.

    If <condition>
    print("Your letter grade is an A")
    elif <condition>
    print("Your letter grade is an B")
    elif <condition>
    print("Your letter grade is an C")
    else
    print("Your letter grade is an F")
    ---------------------------------------- which will ask for the me to input the grade but when hit enter getting error on (if grade > 90 line 6 and so far this is what I got:

    grade = input ('enter grade:')

    if grade > 90:
    print ('Your letter grade is an A')

    elif grade > 80:
    print('Your letter grade is an B')

    elif grade > 70:
    print('Your letter grade is an C')

    else:
    print('Your letter grade is an F')
Tags (2)
0 Kudos
1 Reply
DanPatterson_Retired
MVP Emeritus
this has nothing to do with GIS...post on an appropriate forum that deals exclusively with Python
0 Kudos