Course Assignments
Module 3 Chapter 1 Quiz Answers
Question 1 When Python is running in interactive mode and displaying the chevron prompt (>>>), what question is Python asking you? A. What would you like to do?B. What is the next machine language instruction to run?C. What Python script would you like me to run?D. What is your favorite color? ✅ Correct Answer: A.… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/module-3-chapter-1-quiz-answers/" rel="bookmark"><span class="screen-reader-text">Module 3 Chapter 1 Quiz Answers</span></a>
Assignment: Write Hello World
Programming for Everybody (Getting Started with Python) Module 3 Assignment: Write Hello World Question: Print “hello world” Instructions Write a Python program that: Uses the print() function to display "hello world". Matches the exact output as shown below: hello world Correct Python Code # Corrected print statement print("hello world") Expected Output hello world Explanation The… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/assignment-write-hello-world/" rel="bookmark"><span class="screen-reader-text">Assignment: Write Hello World</span></a>
Module 4 Chapter 2 Answers
Question 1 What is a comment in Python? A. * This is a test B. // This is a test C. /* This is a test */ D. # This is a test ✅ Correct Answer: D. # This is a test 🔹 Explanation: In Python, comments start with a # symbol. Everything after #… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/module-4-chapter-2-answers/" rel="bookmark"><span class="screen-reader-text">Module 4 Chapter 2 Answers</span></a>
Module 4 Assignment 2.2 Answer
2.2 Welcome User Question Write a Python program that: Prompts the user to enter their name. Displays a greeting message using their name. If the user enters Sarah, the expected output should be: Hello Sarah Correct Python Code # Prompt user for input name = input("Enter your name: ") # Display output print("Hello", name) Expected… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/module-4-assignment-2-2/" rel="bookmark"><span class="screen-reader-text">Module 4 Assignment 2.2 Answer</span></a>
Module 4 Assignment 2.3 Answer
2.3 Compute Gross Pay Question Write a Python program that: Prompts the user for hours worked and hourly rate. Computes the gross pay by multiplying hours and rate. Uses 35 hours and a rate of 2.75 per hour for testing (Expected Output: 96.25). Correct Python Code # Prompt user for input hrs = input("Enter Hours:… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/module-4-assignment-2-3/" rel="bookmark"><span class="screen-reader-text">Module 4 Assignment 2.3 Answer</span></a>
Module 5 Chapter 3 Answers
Question 1 What do we do to a Python statement that is immediately after an if statement to indicate that the statement is to be executed only when the if statement is true? A) Start the statement with a “#” character B) Underline all of the conditional code C) Indent the line below the if… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/module-5-chapter-3-answers/" rel="bookmark"><span class="screen-reader-text">Module 5 Chapter 3 Answers</span></a>
Module 5 Assignment 3.1 Answer
3.1 Compute Gross Pay Question Write a Python program that: Prompts the user for hours worked and hourly rate. Pays the regular rate for hours up to 40. Pays 1.5 times the hourly rate for hours above 40. Uses 45 hours and a rate of 10.50 per hour for testing (Expected Output: 498.75). Correct Python… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/2069/" rel="bookmark"><span class="screen-reader-text">Module 5 Assignment 3.1 Answer</span></a>
Module 5 Assignment 3.3 Answer
3.3 Grade Calculation Based on Score Question Write a Python program that: Prompts the user to enter a score between 0.0 and 1.0. If the score is out of range, print "Error: Invalid score" and exit. If the score is valid, print the corresponding grade based on the table below: Score Range Grade >= 0.9… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/module-5-assignment-3-3/" rel="bookmark"><span class="screen-reader-text">Module 5 Assignment 3.3 Answer</span></a>
Module 6 Chapter 4 Answer
Question 1 Which Python keyword indicates the start of a function definition? A. defB. sweetC. continueD. help ✅ Correct Answer: A. def Question 2 In Python, how do you indicate the end of the block of code that makes up the function? A. You add a line that has at least 10 dashesB. You de-indent… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/module-6-chapter-4-answers/" rel="bookmark"><span class="screen-reader-text">Module 6 Chapter 4 Answer</span></a>
Module 6 Assignment 4.6 Answer
4.6 Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay should be the normal rate for hours up to 40 and time-and-a-half for the hourly rate for all hours worked above 40 hours. Put the logic to do the computation of pay in a… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/programming-for-everybody-getting-started-with-python-module-6-assignment-4-6-answer/" rel="bookmark"><span class="screen-reader-text">Module 6 Assignment 4.6 Answer</span></a>
Module 7 Chapter 5 Answer
Question 1 What is wrong with this Python loop? n = 5 while n > 0 : print(n) print('All done') A. This loop will run foreverB. The print('All done') statement should be indented four spacesC. There should be no colon on the while statementD. while is not a Python reserved word ✅ Correct Answer: B.… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/module-7-chapter-5-answer/" rel="bookmark"><span class="screen-reader-text">Module 7 Chapter 5 Answer</span></a>
Module 7 Assignment 5.2 Answer
Programming for Everybody (Getting Started with Python) Module 7 Assignment 5.2 Answer. Question: Find the Largest and Smallest Numbers Instructions Write a Python program that: Repeatedly prompts the user to enter integer numbers. Stops when the user enters "done". Ignores invalid inputs (like "bob") and displays "Invalid input". Finds and prints the largest and smallest… <a href="https://codeshala.io/platform/coursera/course/programming-for-everybody/assignment/2077/" rel="bookmark"><span class="screen-reader-text">Module 7 Assignment 5.2 Answer</span></a>