-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.py
More file actions
47 lines (35 loc) · 1.1 KB
/
Copy pathfunctions.py
File metadata and controls
47 lines (35 loc) · 1.1 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
44
45
46
47
#FUNCIONES
def imprimirMensaje():
print("Python es un lenguaje de progamción.")
print("Me gusta programar con Python")
def imprimirMensaje2(lenguaje): # Le metemos un parametro
print(f"{lenguaje} es un lenguaje de progamción.")
def calculo(a): # Le metemos un parametro
return a + a + a
def sumar(a, b):
return a + b
def restar(a, b):
return a - b
# Este es el punto de entrada
if __name__ == '__main__':
print("Python es un lenguaje de progamción.")
print("Me gusta programar con Python")
imprimirMensaje()
imprimirMensaje()
x = imprimirMensaje2("Python")
#imprimirMensaje2("Java")
print(x)
y = calculo(5)
print(y)
s = sumar(5, 10)
r = restar(5, 10)
print(s)
print(r)
firstNum = int(input("Introduce el primer número: "))
secondNum = int(input("Introducir el segundo número: "))
# suma = sum(firstNum, secondNum)
print(sumar(firstNum, secondNum))
firstNum = int(input("Introduce el primer número: "))
secondNum = int(input("Introduce el segundo número: "))
print(restar(firstNum, secondNum))
#