Question: Inspect input (branching) Write a Python code program that does the following: Given two integers input by the computer user from the console, return their

Inspect input (branching)

Write a Python code program that does the following:

Given two integers input by the computer user from the console, return their product (the first number times the second number) only if the product is greater than 1000, else return their sum (the first number plus the second number).

How to accept user input

See this w3schools lesson https://www.w3schools.com/python/ref_func_input.asp

Hints on handling multiple inputs https://www.geeksforgeeks.org/taking-multiple-inputs-from-user-in-python/

How to change data types (you will need to convert the String from input into some kind of numerical type)

https://www.w3schools.com/python/python_casting.asp https://www.w3schools.com/python/python_casting.asp
(read the examples)


Step by Step Solution

3.34 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python program that takes two integers as input from the user calculates their produc... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!