-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPreInforme9_JeanParra.py
More file actions
65 lines (47 loc) · 1.5 KB
/
PreInforme9_JeanParra.py
File metadata and controls
65 lines (47 loc) · 1.5 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 27 00:08:08 2020
@author: DORIS GELVEZ
"""
#%%ejercicio 19
x1 = float(input("ingrese el valor de x1: "))
x2 = float(input("ingrese el valor de x2: "))
y1 = float(input("ingrese el valor de y1: "))
y2 = float(input("ingrese el valor de y2: "))
d = print("la distancia euclidiana es: " + str(((x2-x1)**2+(y2-y1)**2)**0.5))
#%%ejercicio 23
n = int(input("ingrese un numero de 4 digitos: "))
c4 = n%10
c3 = (n%100)//10
c2 = (n%1000)//100
c1 = (n-(n%1000)) //1000
print(str(c4) + str(c3) + str(c2) + str(c1))
#%%ejercicio 30
n1 = float(input("ingrse la primera nota: "))
n2 = float(input("ingrese la segunda nota: "))
n3 = float(input("ingrese la tercera nota: "))
n4 = float(input("ingrese la cuarta nota: "))
n5 = float(input("ingrese la quinta nota: "))
p1 = n1 * 0.15
p2 = n2 * 0.20
p3 = n3 * 0.15
p4 = n4 * 0.30
p5 = n5 * 0.20
nt = p1 + p2 + p3 + p4 + p5
if nt<2.0:
print ("su nota es: " + str(nt))
elif nt<3.0:
print ("su nota es: " + str(nt) + " reprobo")
elif nt>= 3.0:
print ("su nota es: " + str(nt) + " aprobo")
elif nt > 4.5:
print ("su nota es: " + str(nt) + " felicitaciones")
#%%ejercicio 60
n = int(input("ingrese la cantidad de filas: "))
if n > 0:
for i in range (1, n+1):
print("")
for j in range (1, i+1):
print (j, end=" ")
else:
print("el numero ingresado es invalivo")