EJERCICIO No.1:
edad = 30
if edad >= 0 and edad < 18:
print "eres un niño"
elif edad >= 18 and edad < 27:
print "Eres un joven"
elif edad >= 27 and edad < 60:
print "Eres un adulto"
else:
print "Eres de la tercera edad"

---------------Uso de Bucles----------------
EJERCICIO No.2
edad = 0
while edad <= 20:
print "tienes : " + str(edad)
edad = edad + 1
EJERCICIO No.3
edad = 0
while edad <= 20:
if edad == 15:
edad = edad + 1
continue
print "tienes : " + str(edad)
edad = edad + 1
---------------Uso de librería Datetime----------------
EJERCICIO No.4
import datetime
print (datetime.datetime.now())
import random
valor = random.randint(0,10)
lista = ["uno", "dos", 23,"cuatro"]
valor = random.choice(lista)
print(valor)
import Random
lista = ["uno", "dos", 23,"cuatro"]
print lista
random.shuffle(lista)
print(lista)
---------------Uso de librería Sys----------------
EJERCICIO No.8
No hay comentarios:
Publicar un comentario