Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
executable file
·
30 lines (18 loc) · 718 Bytes

File metadata and controls

executable file
·
30 lines (18 loc) · 718 Bytes
Copy raw file
Download raw file
Outline
Edit and raw actions

Lab 3: Grading

Let's convert a number grade to a letter grade, using if and elif statements and comparisons.

Concepts Covered

  • input, print
  • type conversion (str to int)
  • comparisons (< <= > >=)
  • if, elif, else

Instructions

  1. Have the user enter a number representing the grade (0-100)
  2. Convert the number grade to a letter grade

Numeric Ranges

  • 90-100: A
  • 80-89: B
  • 70-79: C
  • 60-69: D
  • 0-59: F

Version 2 (Optional)

Find the specific letter grade (A+, B-, etc). You can check for more specific ranges using if statements, or use modulus % to get the ones-digit to set another string to '+', '-', or ' '. Then you can concatenate that string with your grade string.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.