In Python, a simple program
Posted: Sun Jul 03, 2022 11:22 am
In Python, a simple program
• Use the input function to get the user's grade (Grade can be A, B, C, D or F) • Use the if statement to compare the grade with the letters A, B, C, D or F • If grade is A - print "Your grade is A" • If grade is B - print "Your grade is B" • If grade is C - print "Your grade is C" • If grade is D - print "Your grade is D" • If grade is F - print "Your grade is F" If grade does not match one of A,B,C,D or F, print "Unknown letter grade" Make sure to use the if, elif and else in your exercise
• Use the input function to get the user's grade (Grade can be A, B, C, D or F) • Use the if statement to compare the grade with the letters A, B, C, D or F • If grade is A - print "Your grade is A" • If grade is B - print "Your grade is B" • If grade is C - print "Your grade is C" • If grade is D - print "Your grade is D" • If grade is F - print "Your grade is F" If grade does not match one of A,B,C,D or F, print "Unknown letter grade" Make sure to use the if, elif and else in your exercise