Question: 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...
1) 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 =0
# Create for statement
for maximum in [60,91,64,70,51,7,49,65,96,39,13,61,78,76,66,16,17,73,34,89]:
if maximum is 0> maximum
# Display results
print("The largest number is", maximum)
Desired Output:
The largest number is 96
2) Write an input validation loop which prevents the user from entering a number larger than 100 or less than 0. Then, enter the appropriate numbers when prompted so you match the output under Desired Output.
# Collect input and assign to /jelly_beans/
jelly_beans = int(input("How many jelly beans do you want? "))
# Write input validation loop
# /jelly_beans/ must be greater than 0
# and less than 100
# Display final result
print("You want", jelly_beans, "jelly beans")
Desired Output:
How many jelly beans do you want? -5
Please enter a number between 0 and 100
How many jelly beans do you want? 200
Please enter a number between 0 and 100
How many jelly beans do you want? 75
You want 75 jelly beans
3) 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

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!