2 print ( " CLASE 00 " ) 3 print ( " * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * " ) 4 # ## TIPOS DE VARIABLES 5 y =10 # tipo entero 6 x =7 7 z = " Hola " # tipo string ( cadena de caracteres ) 8 w =1.5 # tipo float 9 # Imprimiendo algunos resultados con operadores matematicos . 10 print ( x +y ,z , w ) # imprime (16 Hola 15.5) 11 print ( " w * x = " , w * x ) 12 print ( " y / x = " , y / x ) 13 print ( "y - x = " , y - x ) 14 # ## Saltos de linea - tabulacion 15 texto1 = " Si quieres un cambio camina distinto " 16 texto2 = " Si quiers un \ t cambio camina distinto " 17 # \ t : Tabula el texto . 18 texto3 = " Si quiers un \ n cambio camina distinto " 19 # \ n : Nos da un salto de linea . 20 print ( texto1 ) 21 print ( texto2 ) 22 print ( texto3 ) 23 texto4 = """ Si quieres 24 un cambio 25 26 27 camina distinto """ 28 print ( texto4 , " \ n " ) 29 # Cuando usamos """ ( triple comilla doble ) se mostrara exactamente igual 30 # a nuestras lineas de c d i g o , respetando espacios y saltos de linea . 31 32 # ## Concatenacion de caracteres 33 texto1_2 = " Orgullosamente soy " 34 texto2_2 = " ecuatoriano " 35 texto_nuevo = texto1_2 + texto2_2 36 # +: Une los dos textos para convertirlo en uno solo . 37 print ( texto_nuevo ) 38 print ( texto1_2 + texto2_2 , " \ n " ) 39 # Imprime la union de dos textos .
1 CodeMath
40 # ## Tipo de dato BOOLEANOS
41 t = True # tipo booliano ( True se debe escribir con mayuscula la primera letra ) 42 f = False # tipo booliano ( False se debe escribir con mayuscula la primera letra )