osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I'm trying to do this code, can somebody help me


1)Given the variables  x , y , and z , each associated with an int , write a fragment of code that assigns the smallest of these to min

this is what I have

def main():


 x = eval ( input ("dame el numero X"))
 y = eval ( input ("dame el numero Y"))
 z = eval ( input ("dame el numero Z"))
  
 if(x>y and z>y):
  min=y
  print(min)
 else:
  if(y>x and z>x):
    min=x
    print(min)
  else:
   min=z
   print(min)

main()