-
Notifications
You must be signed in to change notification settings - Fork 0
/
datetype.py
51 lines (37 loc) · 880 Bytes
/
datetype.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#Cuatro formas "distintas" de definir strings
#Una vez coma simple o coma doble
print('Hello world')
print("Hello world")
#Tres veces coma simple o coma doble
print('''Hello world''')
print("""Hello world""")
#Imprime "Class str" ya que imprime el tipo de dato que es
print(type("Hello world"))
#Concatenar cadenas de texto y numero
print("Bye"+"World")
#Hacer uso de numeros
#Tipo entero
print(type(30))
#tipo float
print(type(30.1))
#Uso de banderas(Boolean)
#activado
print(type(True))
#Desactivado
print(type(False))
#Listas
[10,20,30,11]
["Hello", "Hola", "Hi", "Buenas"]
["Hello", 10, "Hola", 30, "Hi", 20, "Buenas", 11]
print(type([10,20,30,11]))
#Tuplas(Son inmutables)
(10,20,30,11)
print(type((10,20,30,11)))
#Diccionarios
print(type({
"name":"Johan",
"lastname":"Ontiveros",
"nickname":"Homi12"
}))
#Tipo de dato sin definir
print(type(None))