Question: For all programs: comment your code, use format strings where appropriate, and use concise-and-descriptive variable names. for python class for program 2 quiz program program

 For all programs: comment your code, use format strings where appropriate,

and use concise-and-descriptive variable names. for python class for program 2 quiz

For all programs: comment your code, use format strings where appropriate, and use concise-and-descriptive variable names.

for python class

program program 3 the fourth program is a format string I just

for program 2

quiz program

need help with how to write the programs , and maybe with

program 3

the fourth program is a format string

I just need help with how to write the programs , and maybe with the comment line as well?

Problem 2: Quiz Question (5 points) Re-work the quiz question program from last week's slides (What's the capital of Wisconsin?) but this time, use a while loop, so the user can keep trying answers until they get the answer right. Problem 3: Quiz Question Version 2 (5 points) This program should do the same as Q2, but make these changes: Only let the user have 3 attempts to get the answer correct Count how many attempts it took the user to get the answer right If the user gets the right answer before they run out of attempts, print a message saying how many attempts the user needed If the user runs out of attempts, end the loop and print a message with the correct answer. You can use a for loop or a while loop for this problem. Problem 4: For Loops (5 points) Write a program to calculate the average number of students taking Programming Logic the past four semesters. Write a program that uses a for loop to ask the user for number of students in each of the last four semesters. Your for loop should contain an input ( statement to ask the user for a number of students that semester. Add up all of the user answers, and divide by 4 to calculate the average. Print the average number of students registered for Programming Logic over the last four semesters. For test data, total number of students registered in Programming Logic class for the last 4 semesters was 92, 84, 73, and 90. 12:31 Sal DODOO@ KSSS ? ? (A&M wow. https://raw.githubusercontent.com/claraj/ProgrammingLogico. row.githubusercontent.com O Quiz program. Asks the user a question, and checks if their answer is correct print('Quiz program!') answer = input('What is the capital of Wisconsin?') # It's Madison if answer == 'Madison': print('Correct!') # Problems with this program # 1. The answer has to be in the same case as the answer in the program, so "sacramento" is wrong # 2. The user doesn't see any message if they get the answer wrong Quiz program, version 2. This prints a nessage if the user gets the answer right or wrong. print('Quiz programl') answer - input('What is the capital of Wisconsin? '). It's Madison if answer - Madison: print('Correct!') else print('Sorry, the answer is Madison.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!