Skip to content

Instantly share code, notes, and snippets.

@alphanetEX
Created April 14, 2020 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alphanetEX/fa8cb2b404f44e15b1658e5b0ff3c317 to your computer and use it in GitHub Desktop.
Save alphanetEX/fa8cb2b404f44e15b1658e5b0ff3c317 to your computer and use it in GitHub Desktop.
Realizar un programa que solicite el ingreso de 3 números y mostrar el mayor de ellos.
counter = 0
numbers = [0 , 0 , 0]
while counter < 3:
numbers[counter]= float(input('insert the {} number: '.format(counter +1)))
counter +=1
print('the highest number is : ', max(numbers))
# OTHER LOGIC IF YOUR NOT PERMIT USE MAX FUNCTION
counter = 0
numbers = [0 , 0 , 0]
hight = 0.0
while counter < 3:
numbers[counter]= float(input('insert the {} number: '.format(counter +1)))
if numbers[counter] >= hight:
hight = numbers[counter]
else:
pass
counter += 1
print('the highest number is : ', hight)
# USING LEGACY LOGIC
number_a = float(input("insert the one number: "))
number_b = float(input("insert the second number: "))
number_c = float(input("insert the third number: "))
if number_a > number_b and number_a > number_c:
print("the highest number is:", number_a)
elif number_b > number_a and number_b > number_c:
print("the highest number is:", number_b)
elif number_c > number_a and number_c > number_b:
print("the highest number is:", number_c)
else:
print("it's probably that two or three numbers are equals" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment