Practica #17: Programas hechos en clase
Logaritmo:
2.-
suma
3.-
4.-
5.-
6.-
import time from math import * print "ingresa un primer valor:" x=int(input("")) print"ingresa un segundo valor:" y=int(input("")) s=log(x+y) print"El resultado es:",s time.sleep(5)
2.-
suma
import time from math import * print "Ingresa un primer valor: " x = int(input("")) print "Ingresa un segundo valor: " y = int(input(" ")) suma = x + y time.sleep(5) print "Suma de valores ingresados: " print(suma)
3.-
import math #Funciones aritmeticas a=10 print math.factorial(a) print math.ceil(a)
4.-
#Ejemplo de if import time print "ingrese su nombre:" nombre=raw_input() if nombre=="Yoly": print ("es usted administrador") else: print ("no tiene acceso")
5.-
import time print"Programa que usa if" print "ingrese su nombre" nombre=raw_input() print "cargando password" time.sleep(1) print"*"*1 time.sleep(1) print"*"*2 time.sleep(1) print"*"*3 time.sleep(1) print"*"*4 time.sleep(1) print"*"*5 print "Carga completada 100%" if nombre == "Diana": print "Es usted el administrador" else: print "No es el usuario Root" time.sleep(5)
6.-
import time print "Programa de conversion de decimal a binario " print "Ingrese el numero a convertir: " time.sleep(2) a = input() b = bin(a) print (b) time.sleep(3)
Comentarios
Publicar un comentario