Question

What your Python program should do 1. Get three (3) numbers from the user. Assume the...

What your Python program should do

1. Get three (3) numbers from the user. Assume the user will type in only positive, whole numbers. Don’t forget to add helpful prompts for the user.

2. Using your knowledge of Python…

a. Determine which number is the smallest. Print that number along with some descriptive text to inform the user of what is being printed to the screen.

b. Determine how many numbers are equal (zero, two, or all three). Print that number along with some descriptive text to inform the user of what is being printed to the screen.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hello,

Here is the complete code. Create new file and paste the below code and execute.

#Read input from user
print ("Enter 3 positive numbers")
num1 = int(input(" First Number: "))
num2 = int(input(" Second Number: "))
num3 = int(input(" Third Number: "))

#Determine smallest number
if(num1 <= num2 ):
smallest = num1
else:
smallest = num2

if(num3 < smallest ):
smallest = num3
  
print("\nSmallest of three numbers (",num1, ", ", num2, ", ", num3, "): ", smallest)

#Determine how many numbers are equal
if(num1 == num2 and num2 == num3):
print("\nAll three numbers are common amoung (",num1, ", ", num2, ", ", num3, ")")
elif(num1 == num2 or num2 == num3):
print("\nTwo numbers are common amoung (",num1, ", ", num2, ", ", num3, ")")
else:
print("\nNone of nubmers are common amoung (",num1, ", ", num2, ", ", num3, ")")

input("\nPress any key to continue...");
exit();

Output:

Add a comment
Know the answer?
Add Answer to:
What your Python program should do 1. Get three (3) numbers from the user. Assume the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 5. Write a program in, "Python" that reads 2 numbers from the user. The program should...

    5. Write a program in, "Python" that reads 2 numbers from the user. The program should then print out whether the first number is evenly divisible by the second number.

  • what code in python 3 would I use for this? Write a program that prompts the...

    what code in python 3 would I use for this? Write a program that prompts the user to guess a number between 0 and 10. Your program then picks a random number and tells the user whether their guess is too high, too low or right on! Don't forget to give the user an error if their number is below 0 or above 10. Don't forget to document your code.

  • 1) Translate the following equation into a Python assignment statement 2) Write Python code that prints...

    1) Translate the following equation into a Python assignment statement 2) Write Python code that prints PLUS, MINUS, O ZERO, depending on the value stored in a variable named N. 3) What is printed by: 3 - 1 while 5: while 10 Print ) Page 1 of 9 4) Write a Python while loop that reads in integers until the user enters a negative number, then prints the sum of the numbers. 1-2 of 9 4) Write a Python while...

  • Write a C program that asks the user to enter three numbers (integres). A menu will...

    Write a C program that asks the user to enter three numbers (integres). A menu will be displayed to let the user choose one of the three options: print the two highest numbers, product of the three numbers or the division of the second by the by the third if the third is not zero. See the sample runs. Required: Your code must use -One function to get the numbers from the user One function for each of the three...

  • USING PYTHON 1. Write a small program that asks for an integer number from the user...

    USING PYTHON 1. Write a small program that asks for an integer number from the user and print all the prime numbers (2,3,5,7,etc) less than the input number. 2. How long it takes for your program to print the prime numbers less than 100. (Use magic functions)

  • PYTHON CODING Create a program that prompts the user twice. The first prompt should ask for...

    PYTHON CODING Create a program that prompts the user twice. The first prompt should ask for the user's most challenging course at Wilmington University. The second prompt should ask for the user's second most challenging course. The red boxes indicate the input from the user. Your program should respond with two copies of an enthusiastic comment about both courses. Be sure to include the input provided by the user to display the message. There are many ways to display a...

  • Your mission in this programming assignment is to create a Python program that will take an...

    Your mission in this programming assignment is to create a Python program that will take an input file, determine if the contents of the file contain email addresses and/or phone numbers, create an output file with any found email addresses and phone numbers, and then create an archive with the output file as its contents.   Tasks Your program is to accomplish the following: ‐ Welcome the user to the program ‐ Prompt for and get an input filename, a .txt...

  • Write a program in c++ that generates a 100 random numbers between 1 and 1000 and...

    Write a program in c++ that generates a 100 random numbers between 1 and 1000 and writes them to a data file called "randNum.dat". Then re-open the file, read the 100 numbers, print them to the screen, and find and print the minimum and maximum values. Specifications: If your output or input file fails to open correctly, print an error message that either states: Output file failed to open Input file failed to open depending on whether the output or...

  • 3. Write Python statements that will do the following: a) Input a string from the user....

    3. Write Python statements that will do the following: a) Input a string from the user. *** Print meaningful messages along with your output.* b) Print the length of the String. Example input: The sky is blue. Correct output: The length of the string is 16 Incorrect output: 16 c) Print the first character of the string. d) Print the last character of the string. 4. Save the program. Double-check the left edge for syntax errors or warning symbols before...

  • 1. Modify larger.s to let the user to enter three numbers and output the largest value...

    1. Modify larger.s to let the user to enter three numbers and output the largest value # larger.s-- prints the larger of two numbers specified # at runtime by the user. # Registers used: # $t0 - used to hold the first number. # $t1 - used to hold the second number. # $t2 - used to store the larger of $t1 and $t2. # $v0 - syscall parameter and return value. # $a0 - syscall parameter. .text main: ##...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT