-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpractice.py
62 lines (41 loc) · 1.15 KB
/
practice.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
52
53
54
55
56
57
58
59
60
61
62
#large_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
#splitedd = large_string.split()
#print(len(splitedd))
#####import decimal
#monto = 1000.98
#plata = decimal.Decimal(monto)
#print(type(plata))
#print(plata)
lista = [12, 5, "hola"]
lista.append("el fin")
lista += ["otro fin"]
lista.remove("hola")
print(lista)
print(lista[0:3])
if "hola" in lista:
print("Hay un saludo")
else:
print("No hay saludos")
#for item in lista:
# print(item, end=" ")
rango = range(0, 10, 2)
print(list(rango))
import math
def hipotenusa(p1, p2):
deltx = p1[0] - p2[0]
delty = p1[1] - p2[1]
pitag1 = pow(deltx, 2)
pitag2 = pow(delty, 2)
resultado = math.sqrt(pitag1 + pitag2)
print(resultado)
#hipotenusa((30, 30), (50, 60))
def listcleaner(listToClean):
listToClean = set(listToClean)
list(listToClean)
return listToClean
somelist = [1, 1, 2, 3]
print(listcleaner(somelist))
################################################
li = [1, 2, 55, 77, 2]
for indice, valor in enumerate(li):
print(f"Indice: {str(indice)}, valor: {str(valor)}")