Python Program
Module 3 - Case
CONDITIONAL, ITERATIONS, AND LOOPS
Case Assignment
Case 3 assignments review program flow control with conditionals, loops, and iterations.
Review the videos and read chapter 9, and 10 (sections 10.1 – 10.4 and 10.7 only) in the online book of "Python 2: For Beginners Only” and complete the following exercises from “Python 2: For Beginners Only.”
Exercise 9.2, Exercise 9.3
Exercise10.2, Exercise 10.3
Create a Word file named as “ITM205-Case 3-Exercises-YourFirstNameLastName”containing a copy of each of the exercises’ IDLE source codes and running results with clear exercise numbers marked on the page.
You can use the Snipping tools or screen print (ctrl + Print Screen) to show the Pythons editor’s (IDLE) code and results and demonstrate that your program executed correctly.
Write a summary document in Microsoft Word format named as “ITM205-Case3-Summary-YourFirstNameLastName” to show what you have accomplished.
Students Name:
Topic:
Institution:
Date:
Exercise 9.2
Write a Python program that collects from the user a single integer. Have the program print "EVEN" if the integer is divisible by 2, and "ODD" if the integer is not divisible by two
num = 0
print("This program checks for EVEN or ODD numbers")
while (num != -1): #Continue looping unless user inputs -1
num = int(input("Enter a number: ")) #Get user input
if (num % 2 == 0): #Check if the number is divisible by 2 i.e. is EVEN
print("EVEN")
else:
print("ODD")
Exercise 9.3
Write a Python program that collects from the user two integer...
👀 Other Visitors are Viewing These APA Essay Samples:
-
Conditional Iterations and Loops
2 pages/≈550 words | No Sources | APA | Technology | Coursework |
-
Operating Systems and Environments
2 pages/≈550 words | 6 Sources | APA | Technology | Coursework |
-
Information Technology and the Modern Enterprise
3 pages/≈825 words | 6 Sources | APA | Technology | Coursework |