Inspect input (branching) Write a Python code program that does the following: Given two integers input by the computer user
This problem has been solved!
Do you need an answer to a question different from the above? Ask your question!
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
View Solution
Create a free account to access the answer
Cannot find your solution?
Post a FREE question now and get an answer within minutes.
* Average response time.
Question Details
Chapter #
8
Section: Review Exercises
Problem: 13
Posted Date: September 14, 2023 03:43:59