Create a program that takes in two numbers and returns the highest of the two

print("Enter two numbers. I will tell the highest of the two.") num1 = input("Number 1: ") num2 = input("Number 2: ") if (num1 == num 2) print ("They are the same".) else if (num1 > num2) print (num1) else print (num2)

Answered by Dom H. Python tutor

1560 Views

See similar Python Mentoring tutors

Related Python Mentoring answers

All answers ▸

Write a function that takes an imput (call it usr_in), the user's age (usr_age) and the user's name (usr_nm) and outputs the following string: "Hi, My name is [usr_nm], I am [usr_age] years old, and my favorite number is [usr_in]"


Give a segment of python code that will print the numbers 1 to 7, each one on a new line


Creating string from multiple strings(or characters)


How can you take a list of numbers and add 3 to every number in the list using only one line of code?


We're here to help

contact us iconContact usWhatsapp logoMessage us on Whatsapptelephone icon+44 (0) 203 773 6020
Facebook logoInstagram logoLinkedIn logo

© MyTutorWeb Ltd 2013–2025

Terms & Conditions|Privacy Policy
Cookie Preferences