Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For all programs: comment your code, use format strings where appropriate, and use concise-and-descriptive variable names. I need help with these questions for my python

image text in transcribed

image text in transcribed

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

I need help with these questions for my python class, I was also wondering what to write for the comment lines!!!

image text in transcribed

this is the quiz question

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. Quiz program. Asks the user a question, and checks if their answer is correct II III 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions