Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help. Try to solve it but output doesn't match. please use Python... 1 ) Let's discover the largest number in a long list of
Need help. Try to solve it but output doesn't match. please use Python...
Let's discover the largest number in a long list of numbers. Write a script which uses a for statement to compare values in the list function to match the output under Desired Output.
# Create the maximum variable
maximum
# Create for statement
for maximum in :
if maximum is maximum
# Display results
printThe largest number is maximum
Desired Output:
The largest number is
Write an input validation loop which prevents the user from entering a number larger than or less than Then, enter the appropriate numbers when prompted so you match the output under Desired Output.
# Collect input and assign to jellybeans
jellybeans intinputHow many jelly beans do you want?
# Write input validation loop
# jellybeans must be greater than
# and less than
# Display final result
printYou want", jellybeans, "jelly beans"
Desired Output:
How many jelly beans do you want?
Please enter a number between and
How many jelly beans do you want?
Please enter a number between and
How many jelly beans do you want?
You want jelly beans
Use a for loop and the range function to match the output under Desired Output.
Desired Output:
Hi
Hi
Hi
Hi
Hi
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started