Posted: November 4th, 2017

Write a Python program that prompts the user to enter an integer and reports whether the input was even or odd

Instructions

This is a practice activity that will prepare you for this module’s graded assignment. It is NOT graded but you must submit an attempt to this dropbox in order to have the solution file revealed to you. The task is to solve a problem with a Python program. After completing this activity and uploading your Python file, you will be able to view a video detailing an exemplary solutions provided by your instructor.

Requirements

Two programs are required. In each program:

  • Start with a comment that includes your name and course number.
  • Include pseudocode that describes all steps required to solve the problem.
  • Employ variable names that describe the values they store and adhere to Python naming conventions.
  • Include additional comments as needed to annotate your code.
  • Use correct spelling and grammar.

1. Write a Python program that uses a for loop with the range function to display the integers from 5 to 50 in increments of 5. See page 170-173 to learn about the range function. The program should also print the square and cube of each integer. Your output should print the a table with 3 columns and each column should be 7 characters wide. See page 72-73 for how to format integers. See also example output.

EXAMPLE OUTPUT
squares_cubes

2. Write a Python program that prompts the user to enter an integer and reports whether the input was even or odd. Assume that the user follows instructions and enters only integers. The program must use a while loop and it should continue to execute until the user enters zero. See pages 144-146 to learn about sentinels.
EXAMPLE OUTPUT

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Live Chat+1-631-333-0101EmailWhatsApp