Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: utf-8
- # Números Oscilantes
- # Amanda Luna [116210896] / UFCG
- def oscilantes(cod) :
- condicao = False
- list(cod)
- for i in range(len(cod)-1) :
- if cod[i]%2 == 0 and cod[i+1]%2 != 0 or cod[i]%2 != 0 and cod[i+1]%2 == 0 :
- condicao = True
- return condicao
- codigo = raw_input().split()
- oscilantes(codigo)
- qtd = len(codigo)
- if condicao :
- print "Verdadeiro: %d" % qtd
- else :
- print "Falso: %d" % qtd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement