Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write program in python 3 (IDLE) Thisweek's lab is to create a simple multiplication table using nested loops and if statements. Prompt the user

image text in transcribed
image text in transcribed
Please write program in python 3 (IDLE)
Thisweek's lab is to create a simple multiplication table using nested loops and if statements. Prompt the user for the size of the multiplication table (from 2x2 to 10x10). Use a validation loop to display a warning if the number is less than 2 or greater than 10 and prompt the user to enter the data again until they enter a valid number. Put a # after any even number in your table (odd numbers will have just a spaceothing after them). Lab Steps Sample Output: The output should be something similar to the following. What size multiplication table would you like? (2 T 10): 1T Invalid entry Enter a number between 2 and 10 What size multiplication table would you like? (2 10) 15 Invalid entry Enter a number between 2 and 10 What size multiplication table would you like? (2 10): 10 Multiplication Table ( 10 x 10 7 10 3 2# 3 6# 9 10 # 2# 4# 61 8# 10# 12 # 14# 16 # 18# 20# 30 # 4# 8# 12# 16 # 20# 24 # 28 # 32# 36 # 40# 5 10# 15 20 # 25 30# 35 40 # 45 50 # 6# 12# 18 # 24# 30# 36 # 42 # 48 # 54 # 60# 70 # 8# 16# 24 # 32 # 40 # 48 # 56 # 64 # 72 # 80 # 90 # 10 t 20# 30# 40# 50# 60# 70# 80# 90 # 1001 5 67 8# 9 21 3 12# 15 18# 21 24# 27 7 14# 21 28# 35 42# 49 56# 63 18# 27 36# 45 54# 63 72# 81 101 Hints: The outer loop will start each new row. The inner loop will control the display of each column in the row. . Note that to keep the numbers right-aligned, there are different amounts of space before single digit numbers (thoselessthan 10), double digit numbers (those between 10-99), and triple digit numbers (100). The row labels can be added to your inner loop (note that there are different amounts of space required after the number in the row labels. The column labels should use a separate loop(s) that run before the main outer loop You can continue printing on the same line using end-i" in your print statement. This will come in handy if you want to print several things on one line inside a loop. For example, assuming the value of name is Ada, the following will print "Hello Ada" o line: n one print("hello ", end-" print(name, end="")

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions