lunes, 9 de febrero de 2015

Use of the conditional IF

The random numbers program in here shows a great example of the If conditional being used. You basically set your conditinial, write a colon, and in the next lines you write the code with an identation of all the steps that will follow beeing the conditional truth. 
example: 
x = int(input("give me a number"))
if(x>0):
           print(x," is a positive number")
if(x<0):
          print(x," is a negative number")
if(x==0):
          print(x," is cero")


No hay comentarios:

Publicar un comentario