-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path08_functions.py
More file actions
43 lines (34 loc) · 1.09 KB
/
08_functions.py
File metadata and controls
43 lines (34 loc) · 1.09 KB
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
# def caeser(message, key):
# message = message.lower()
# result = ""
# for character in message:
# if character.isalpha():
# numero_letra_codificada = ord(character)+key
# if numero_letra_codificada >= 123:
# numero_letra_codificada -= 26
# letra_codificada = chr(numero_letra_codificada)
# result += letra_codificada.upper()
# else:
# result += character
# return result
# # caeser("This is a message", 1)
# # Uijt jt b nfttbhf
# # print(caeser("who are you?", 18)) # OZG SJW QGM?
# print(caeser("WHO ARE YOU?", 18)) # OZG SJW QGM?
# # caeser("..5tyu..", 25)
# # caeser("..#$%^..", 0)
# # caeser("..#$%^..", 26)
# # caeser("final one", 9)
# def nombre_funcion(param1, param2):
# otra_variable = 23
# print(f"0 días desde el último accidente: {param1}-{param2}")
# dias = 12
# tipo = "personas"
# nombre_funcion(32, "personas")
# nombre_funcion("días", "libres")
# nombre_funcion(dias, tipo)
def cuadrado_numero(numero):
return numero ** 2
numero1 = 4
numero2 = cuadrado_numero(numero1)
print(f"El cuadrado de {numero1} es {numero2}")