Question

PYTHON PART 1) SIMPLE IF STATEMENTS INSIDE A LOOP. The first part of your program should...

PYTHON

PART 1) SIMPLE IF STATEMENTS INSIDE A LOOP. The first part of your program should do the following: • Write a section of code that prints off the numbers from 50 to 100. • It should also print off the letter grade that goes with that number on the same line using an if statement

o 0 – 59 = F

o 60 – 69 = D

o 70 – 79 = C

o 80 – 89 = B

o 90+ = A

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Source Code:

Х 1.py - C:/Users/Kumar Reddi/Desktop/1.py (3.8.2) File Edit Format Run Options Window Help #print header print (Score\tGrad

Output:

TI Python 3.8.2 Shell File Edit Shell Debug Options Window Help Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSС С С B B B B 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 B B B B B 92 93 94 95 96 97 98 99 100 B A A A A A A A A A A A

Code in text format (See above image of code for indentation):

#print header
print("Score\tGrade")
#for loop to print numbers from 50 to 100
for i in range(50,101):
#print number
print(i,end="\t")
#check for F grade
if(i<60):
print("F")
#check for D grade
if(i>=60 and i<70):
print("D")
#check for C grade
if(i>=70 and i<80):
print("C")
#check for B grade
if(i>=80 and i<90):
print("B")
#check for A grade
if(i>=90):
print("A")

Add a comment
Know the answer?
Add Answer to:
PYTHON PART 1) SIMPLE IF STATEMENTS INSIDE A LOOP. The first part of your program should...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • [Using Python] Use the grade scale in the syllabus for this class, write a program that...

    [Using Python] Use the grade scale in the syllabus for this class, write a program that inputs a score, and prints the grade for that score. For example, if I input 90.0, your program should print A. Grading Scale is: 100% - 90% A 89% - 80% B 79% - 70% C 69% - 60% D 59% - 0% E

  • Python: Create a simple program that calls a function call gradeCalculated, in the main area the...

    Python: Create a simple program that calls a function call gradeCalculated, in the main area the user is asked to enter their grade from 0-100. Pass in the number grade via a parameter into the function, based on their grade tell the user what letter grade they got as a letter grade and number and then tell me a quote how you feel about your grade. 90+ A 80-89 B 70-79 C 60-69 D Below 60 F

  • Create a MIPS program that does the following: 4. Determine the letter grade a. Use the...

    Create a MIPS program that does the following: 4. Determine the letter grade a. Use the floating point calculated average to determine the letter grade. You will need to research the instructions to use to do comparisons with floating point numbers. (see Course Resources) b. Use the following chart: 90 - 100 80 - 89 70 - 79 ............. 60 - 69.............. <60 ..................... ............... 5. Display a message and the letter grade. 6. Your output should look similar to...

  • I want to know how to do this assignment!!! Help me please~ The first part of...

    I want to know how to do this assignment!!! Help me please~ The first part of your program should do the following: • Ask the user type of test they took. o (ACT or SAT) • If they said ACT then ask them their score o If their ACT score was between 0 and 7 say "Needs Work" o If their ACT score was between 10 and 20 say "Acceptable" o If they ACT score was above 20 say "Above...

  • 1. Create a program that takes a numerical score and outputs a letter grade. 2. In...

    1. Create a program that takes a numerical score and outputs a letter grade. 2. In this program, create two void functions titled makeScore and theGrade with an int argument. 3. The function makeScore should have a Reference parameter and theGrade should have a Value parameter. Note: Specific numerical scores and letter grades are listed below: 90-100 = Grade A 80-89 = Grade B 70-79 = Grade C 60-69 = Grade D 0-59 = Grade F 4. The function makeScore...

  • We want to create a program which prints off what letter grade an individual receives based...

    We want to create a program which prints off what letter grade an individual receives based upon whether or not their grade obeys the following condition: grade>= 90 and grade = 80 and grade<89, we will print off “You made a B”, so on and so forth. In this program, we can assume that we are asking the user to enter whatever grade they recieved as a numeric input. NEED HELP WITH ALL PARTS! 4.) Consider the example of grades...

  • Write a python nested for loop that prints out the following pattern 100 99 98 97...

    Write a python nested for loop that prints out the following pattern 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33...

  • Write a C++ program that will provide a user with a grade range if they enter...

    Write a C++ program that will provide a user with a grade range if they enter a letter grade. Your program should contain one function. Your function will accept one argument of type char and will not return anything (the return type will be void), but rather print statements to the console. Your main function will contain code to prompt the user to enter a letter grade. It will pass the letter grade entered by the user to your function....

  • Write python code on computer, No handwritten code You will implement a program which asks the...

    Write python code on computer, No handwritten code You will implement a program which asks the user to enter scores of different courses in different semesters. The program should read the input and output some simple statistics 1. An example input string by the user is given below. Fal12016-coursel:82, course2:80,course3:85;Spring2018- course4:82;Fall2018-course5:85, course6:50, course7:78 Info from different semesters are separated by a ";", courses in each semester are separated by a,and score and corresponding course is separated by a, information of...

  • Using Dev C++, write a program to solve the problem as stated below. Write a program...

    Using Dev C++, write a program to solve the problem as stated below. Write a program will input a single integer value (all input will be exactly 8 digits long) and will store pairs of digits as individual integer values. The program will display the five 2-digit numbers as well as the average of these, each on their own line. Use a switch statement to print out Grade: and then either A (>=90), B ([80..89]), C ([70..79]), D ([60..69]) or...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT