Skip to content

Commit f9d222c

Browse files
committed
Formateo de código existente
1 parent 146e64e commit f9d222c

27 files changed

+180
-123
lines changed

Backend/FastAPI/main.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,21 @@
1111
app = FastAPI()
1212

1313
# Url local: http://127.0.0.1:8000
14+
15+
1416
@app.get("/")
1517
async def root():
1618
return "Hola FastAPI!"
1719

1820
# Url local: http://127.0.0.1:8000/url
21+
22+
1923
@app.get("/url")
2024
async def url():
21-
return { "url":"https://mouredev.com/python" }
25+
return {"url": "https://mouredev.com/python"}
2226

2327
# Inicia el server: uvicorn main:app --reload
2428
# Detener el server: CTRL+C
2529

2630
# Documentación con Swagger: http://127.0.0.1:8000/docs
27-
# Documentación con Redocly: http://127.0.0.1:8000/redoc
31+
# Documentación con Redocly: http://127.0.0.1:8000/redoc

Backend/type_hints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
my_typed_variable = 5
1818
print(my_typed_variable)
19-
print(type(my_typed_variable))
19+
print(type(my_typed_variable))

Basic/00_helloworld.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
'''
2222

2323
# Cómo consultar el tipo de dato
24-
print(type("Soy un dato str")) # Tipo 'str'
25-
print(type(5)) # Tipo 'int'
26-
print(type(1.5)) # Tipo 'float'
27-
print(type(3 + 1j)) # Tipo 'complex'
28-
print(type(True)) # Tipo 'bool'
29-
print(type(print("Mi cadena de texto"))) # Tipo 'NoneType'
24+
print(type("Soy un dato str")) # Tipo 'str'
25+
print(type(5)) # Tipo 'int'
26+
print(type(1.5)) # Tipo 'float'
27+
print(type(3 + 1j)) # Tipo 'complex'
28+
print(type(True)) # Tipo 'bool'
29+
print(type(print("Mi cadena de texto"))) # Tipo 'NoneType'

Basic/01_variables.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
# Variables en una sola línea. ¡Cuidado con abusar de esta sintaxis!
2626
name, surname, alias, age = "Brais", "Moure", 'MoureDev', 35
27-
print("Me llamo:", name, surname, ". Mi edad es:", age, ". Y mi alias es:", alias)
27+
print("Me llamo:", name, surname, ". Mi edad es:",
28+
age, ". Y mi alias es:", alias)
2829

2930
# Inputs
3031
name = input('¿Cuál es tu nombre? ')
@@ -43,4 +44,4 @@
4344
address = True
4445
address = 5
4546
address = 1.2
46-
print(type(address))
47+
print(type(address))

Basic/02_operators.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@
2626
### Operadores Comparativos ###
2727

2828
# Operaciones con enteros
29-
print(3 > 4)
29+
print(3 > 4)
3030
print(3 < 4)
3131
print(3 >= 4)
3232
print(4 <= 4)
3333
print(3 == 4)
3434
print(3 != 4)
3535

3636
# Operaciones con cadenas de texto
37-
print("Hola" > "Python")
37+
print("Hola" > "Python")
3838
print("Hola" < "Python")
39-
print("aaaa" >= "abaa") # Ordenación alfabética por ASCII
40-
print(len("aaaa") >= len("abaa")) # Cuenta caracteres
39+
print("aaaa" >= "abaa") # Ordenación alfabética por ASCII
40+
print(len("aaaa") >= len("abaa")) # Cuenta caracteres
4141
print("Hola" <= "Python")
4242
print("Hola" == "Hola")
4343
print("Hola" != "Python")
@@ -50,4 +50,4 @@
5050
print(3 < 4 and "Hola" < "Python")
5151
print(3 < 4 or "Hola" > "Python")
5252
print(3 < 4 or ("Hola" > "Python" and 4 == 4))
53-
print(not(3 > 4))
53+
print(not (3 > 4))

Basic/03_strings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
name, surname, age = "Brais", "Moure", 35
2424
print("Mi nombre es {} {} y mi edad es {}".format(name, surname, age))
25-
print("Mi nombre es %s %s y mi edad es %d" %(name, surname, age))
25+
print("Mi nombre es %s %s y mi edad es %d" % (name, surname, age))
2626
print("Mi nombre es " + name + " " + surname + " y mi edad es " + str(age))
2727
print(f"Mi nombre es {name} {surname} y mi edad es {age}")
2828

@@ -62,4 +62,4 @@
6262
print(language.lower())
6363
print(language.lower().isupper())
6464
print(language.startswith("Py"))
65-
print("Py" == "py") # No es lo mismo
65+
print("Py" == "py") # No es lo mismo

Basic/04_lists.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
print(my_other_list[-1])
2727
print(my_other_list[-4])
2828
print(my_list.count(30))
29-
#print(my_other_list[4]) IndexError
30-
#print(my_other_list[-5]) IndexError
29+
# print(my_other_list[4]) IndexError
30+
# print(my_other_list[-5]) IndexError
3131

3232
print(my_other_list.index("Brais"))
3333

Basic/05_tuples.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717

1818
print(my_tuple[0])
1919
print(my_tuple[-1])
20-
#print(my_tuple[4]) IndexError
21-
#print(my_tuple[-6]) IndexError
20+
# print(my_tuple[4]) IndexError
21+
# print(my_tuple[-6]) IndexError
2222

2323
print(my_tuple.count("Brais"))
2424
print(my_tuple.index("Moure"))
2525
print(my_tuple.index("Brais"))
2626

27-
#my_tuple[1] = 1.80 'tuple' object does not support item assignment
27+
# my_tuple[1] = 1.80 'tuple' object does not support item assignment
2828

2929
# Concatenación
3030

@@ -48,7 +48,7 @@
4848

4949
# Eliminación
5050

51-
#del my_tuple[2] TypeError: 'tuple' object doesn't support item deletion
51+
# del my_tuple[2] TypeError: 'tuple' object doesn't support item deletion
5252

5353
del my_tuple
54-
#print(my_tuple) NameError: name 'my_tuple' is not defined
54+
# print(my_tuple) NameError: name 'my_tuple' is not defined

Basic/06_sets.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
my_other_set = {}
99

1010
print(type(my_set))
11-
print(type(my_other_set)) # Inicialmente es un diccionario
11+
print(type(my_other_set)) # Inicialmente es un diccionario
1212

13-
my_other_set = {"Brais","Moure", 35}
13+
my_other_set = {"Brais", "Moure", 35}
1414
print(type(my_other_set))
1515

1616
print(len(my_other_set))
@@ -19,9 +19,9 @@
1919

2020
my_other_set.add("MoureDev")
2121

22-
print(my_other_set) # Un set no es una estructura ordenada
22+
print(my_other_set) # Un set no es una estructura ordenada
2323

24-
my_other_set.add("MoureDev") # Un set no admite repetidos
24+
my_other_set.add("MoureDev") # Un set no admite repetidos
2525

2626
print(my_other_set)
2727

@@ -39,19 +39,19 @@
3939
print(len(my_other_set))
4040

4141
del my_other_set
42-
#print(my_other_set) NameError: name 'my_other_set' is not defined
42+
# print(my_other_set) NameError: name 'my_other_set' is not defined
4343

4444
# Transformación
4545

46-
my_set = {"Brais","Moure", 35}
46+
my_set = {"Brais", "Moure", 35}
4747
my_list = list(my_set)
4848
print(my_list)
4949
print(my_list[0])
5050

51-
my_other_set = {"Kotlin","Swift", "Python"}
51+
my_other_set = {"Kotlin", "Swift", "Python"}
5252

5353
# Otras operaciones
5454

5555
my_new_set = my_set.union(my_other_set)
5656
print(my_new_set.union(my_new_set).union(my_set).union({"JavaScript", "C#"}))
57-
print(my_new_set.difference(my_set))
57+
print(my_new_set.difference(my_set))

Basic/07_dicts.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@
1010
print(type(my_dict))
1111
print(type(my_other_dict))
1212

13-
my_other_dict = {"Nombre":"Brais", "Apellido":"Moure", "Edad":35, 1:"Python"}
13+
my_other_dict = {"Nombre": "Brais",
14+
"Apellido": "Moure", "Edad": 35, 1: "Python"}
1415

1516
my_dict = {
16-
"Nombre":"Brais",
17-
"Apellido":"Moure",
18-
"Edad":35,
19-
"Lenguajes": {"Python","Swift", "Kotlin"},
20-
1:1.77
21-
}
17+
"Nombre": "Brais",
18+
"Apellido": "Moure",
19+
"Edad": 35,
20+
"Lenguajes": {"Python", "Swift", "Kotlin"},
21+
1: 1.77
22+
}
2223

2324
print(my_other_dict)
2425
print(my_dict)
@@ -72,4 +73,4 @@
7273
print(my_new_dict.values())
7374
print(list(dict.fromkeys(list(my_new_dict.values())).keys()))
7475
print(tuple(my_new_dict))
75-
print(set(my_new_dict))
76+
print(set(my_new_dict))

0 commit comments

Comments
 (0)