This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ALBERT FRAND NINA QUISPE | |
| #Operadores en Python | |
| #1. Operadores Aritmeticos | |
| suma = 5+5 | |
| resta = 10-6 | |
| multiplicacion = 5*5 | |
| division = 10/2 | |
| modulo = 10%2 | |
| exponentes = 10**2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ALBERT FRAND NINA QUISPE | |
| #tipos de datos en python | |
| #1. tipo de dato numerico (int) | |
| edad:int = 25 | |
| promedio = 19 | |
| numero = -50 | |
| #2. tipo de dato decimal (float) | |
| peso:float = 75.50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ALBERT FRAND NINA QUISPE | |
| #Valida contraseña | |
| contrasenia_correcta = '123456' | |
| intentos = 0 | |
| while True: | |
| contrasenia = input('Ingrese la contraseña: ') | |
| intentos += 1 | |
| if contrasenia == contrasenia_correcta: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #ALBERT FRAND NINA QUISPE | |
| #imprimir los numeros del 1 al 20 | |
| for i in range(1, 21): | |
| print(i) | |
| pass | |
| #Imprime los numeros pares del 1 al 20 | |
| for i in range(1, 21,2): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##----------------------------- | |
| #ALBERT FRAND NINA QUISPE | |
| nota1 = 5 | |
| nota2 = 15 | |
| nota3 = 20 | |
| promedio = ((nota1 + nota2 + nota3) / 3) | |
| print("El promedio es: ", promedio) | |
| if(promedio >= 17): | |
| print("Excelente") | |
| elif(promedio >= 14): |