Write a program that asks the p34won to enter their grade, and then prints GRADE is a fun grade. Your program should repeat these steps until the user inputs I graduated

Answers

Answer 1

Answer:

Following are the code to this question:

def fun():#defining a method fun

  while True:#defining a while loop  

      g = input("Enter your grade: (I graduated) ")#defining variable g for input value

      if g == "I graduated":#defining if block to check string value

          return 0#return  

      print("{} is a fun grade".format(g))#use print method to print string value  

fun()#calling the method

Output:

Enter your grade: (I graduated) 1st

1st is a fun grade

Enter your grade: (I graduated) 2nd

2nd is a fun grade

Enter your grade: (I graduated) I graduated

Explanation:

In the given python code, a method "fun" is defined, and inside the method, a while loop is defined, which uses a variable "g" for input value from the user-end.

In the next step, if block is defined to check string a value and return a value 0, and use the print method to print the given value, and call the above method fun.  


Related Questions

Other Questions
what is makaton detailed description My Fav Football team whats yours? Follow and Like Please answer all 3 for 20 points Stormer Company reports the following amounts on its statement of cash flow: Net cash provided by operating activities was $37,500; net cash used in investing activities was $13,800 and net cash used in financing activities was $17,700. If the beginning cash balance is $6,900, what is the ending cash balance? a) $75,900. b) $62,100. c) $40,500. d) $6,000. $12,900. White House pets often become almost almost as well known as their owners A-action verbB-helping verbC-linking verbD- none of the above please can someone solve If a line is parallel to y=-6x +3 , what is the slop of that line ?A.-6B.3C.8D.1/6 Jessica wants to go on a school trip next month. The trip will cost $100 and she already has $10 and plans to babysit for $5 an hour to earn the rest of the money.A. Write an equation that could be used to determine h, the number of hours Jessica needs to babysit to earn $100.B. From your equation, determine the number of hours she needs to babysit. What was the significance of Frances Perkinss role in the Roosevelt administration? A. She was the first female Vice President. B. She was the first female leader of the Democratic Party. C. She was the first female Democratic representative. D. She was the first female Cabinet member. Use the abbreviations below to label the sentence pattern.S = SubjectV = VerbIO = Indirect ObjectDO = Direct ObjectPA = Predicate AdjectivePN = Predicate NounLeroy swims at 3:00 p.m. every day. Why did the peasants resent the nobles?A. The nobles were richer than the peasants.B. The peasants owed the nobles certain duties in return for their livelihood.C. There were not enough nobles to meet the peasants needs.D. The nobles owned all the shops The favored metal of Islamic artists is predict how many moles of nh3 would be made if 6.00 moles of h2 were used N2 it only has to be a paragraph please help me you dont have to write a lot!!!! 8.Andrew has $76.50. Elijah has $94.30. How much more money does Elijah have thanAndrew I need helpWrite a summary of todays passage. A park is showing a movie on the lawn. The base of the screen is 6 feet off the ground and the screen is 22 feet high (see figure). A fiction writer can take _____ with names, dates, actions, and orders. A nonfiction writer must tell things as _____. Josephs lunch at a restaurant costs $13.00, without tax. He leaves the waiter a tip of 17% of the cost of the lunch, without tax. What is the total cost of the lunch, including the tip without tax? * Check my answers plz