Question

Flowchart + Python. Ask the user for a value. Then, ask the user for the number...

Flowchart + Python.

Ask the user for a value. Then, ask the user for the number of expressions of that value. Use While Loops to make a program.

So then, it should be so that 5 expressions for the value 9 would be:
9 * 1 = 9
9 * 2 = 18
9 * 3 = 27
9 * 4 = 36
9 * 5 = 45

Flowcharts and Python Code. Not just Python code.

Homework Answers

Answer #1

If you have any queries please comment in the comments section I will surely help you out and if you found this solution to be helpful kindly upvote.

Solution :

# function to calculate and return the product
def calculate(val,i):
# calculate product
prod = val*i
# return the product
return prod
# function to display the table
def display(val,n):
# initialize i=1
i=1
# iterate while loop n times
while(i<=n):
# call the calculate function to get the product
prod=calculate(val,i)
# print val, i and product
print(val,"*",i,"=",prod)
# increment i
i=i+1
# function to take input
def take_input():
# input value
val = int(input())
# input the number of expressions
n = int(input())
# call the display function
display(val,n)
# call the take_input function
take_input()

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Write a python code that will ask the user to enter an integer number n. Construct...
Write a python code that will ask the user to enter an integer number n. Construct a recursive function that prints numbers 1 to n in the form “11223344..nn”.
IN PYTHON : Write a program that asks the user for a number. Write the number...
IN PYTHON : Write a program that asks the user for a number. Write the number to a file called total.txt. Then ask the user for a second number. Write the new number on line 2 with the total for both numbers next to it separated by a comma. Then ask the user for a third number and do the same. Keep asking for numbers until the person puts in a zero to terminate the program. Close the file. Be...
Create a flowchart that asks the user to enter a number. (Assume this number is integer!)...
Create a flowchart that asks the user to enter a number. (Assume this number is integer!) If the number is multiple of 5 then show a message that says “HiFive”. If the number is multiple of 3 then show a message that says “HiThree”. If the number is multiple of 2 then show a message that says “HiTwo”. Then end the Flowchart. (Tip: Use the % symbol for modulus operation) (Tip2: If the number is not a multiple of 5,...
(8 marks) Write a program to ask user to input an integer and display the special...
Write a program to ask user to input an integer and display the special pattern accordingly. REQUIREMENTS The user input is always correct (input verification is not required). Your code must use loop statements (for, while or do-while). Your program should use only the following 3 output statements, one of EACH of the followings: System.out.print("-"); // print # System.out.print("+"); // print + System.out.println(); // print a newline Your code must work exactly like the following example (the text in bold...
On Python Ask the user to input a min and a max value for a range...
On Python Ask the user to input a min and a max value for a range of numbers. Then use range(min, max) to: a) Loop through the range specified by the user and find all the numbers that are divisible by 3 and print them. b) Loop through the range and find only the first multiple of 3 and print it.
Using Python, write the following code. You are to allow the user to enter the daily...
Using Python, write the following code. You are to allow the user to enter the daily temperature as a floating-point number. You should make the assumption that you are recording temperatures in Fahrenheit. You should allow the user to continue entering temperatures until the value -999 is entered. This number should not be considered a temperature, but just a flag to stop the program. As the user enters a temperature, you should display the following each time: Current Temperature: 999...
Write a program (also write its pseudocode and draw its flowchart) to prompt the user to...
Write a program (also write its pseudocode and draw its flowchart) to prompt the user to input the variables to solve the following problem: X2 + X×Y/Z – W*V3 Note 1: You should ask the user to input 5 number to be able to do this calculation. Note 2: You can use multiplication instead of power if you do not want to use it (as we have not officially covered it).
Question: Write a C++ program to ask the user to give you the number of rows...
Question: Write a C++ program to ask the user to give you the number of rows and number of columns, then make the multiplication table by using nested loop. For example, if the user enters 3 for rows and 4 for columns then the multiplication table would be like the following: 1    2   3     4 1   1 2 3 4 2   2    4      6    8 3    3 6 9 12
PYTHON Ask the user for a value N (0 ≤ N < 10) Create a 2-D...
PYTHON Ask the user for a value N (0 ≤ N < 10) Create a 2-D list in an N X N structure with integers 1-(N*N) Print the list created Reverse the list such that (1) each list in the 2D list is reversed and (2) the order of each list in the outer list is reversed (see example) Print the reversed list Example Execution What size 2D list would you like to create? N> 3 The original list is:...
Write a C program to ask the user 3 number and display in the greater value...
Write a C program to ask the user 3 number and display in the greater value from it. Only use compound condition in if-Else statements.