Inspect input (branching) Write a Python code program that does the following: Given two integers input by
Fantastic news! We've Found the answer you've been seeking!
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 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)
Related Book For
Posted Date: