Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
robertopucp
GitHub Repository: robertopucp/1eco35_2022_2
Path: blob/main/Trabajo_grupal/GRUPO_10_py.ipynb
2714 views
Kernel: Python 3 (ipykernel)
##PREGUNTA 1## import numpy as np m=20 f_x=np.zeros(m) for i in range (m): x=int(input('num=')) while x<0 or x>500: x=int(input('vuelva a digitar num=')) if x<100: f_x[i]=x**(1/2) elif x<300: f_x[i]=x-5 else: f_x[i]=50 print(f_x)
num=10 num=50 num=80 num=90 num=100 num=120 num=200 num=270 num=400 num=378 num=456 num=12 num=156 num=245 num=347 num=321 num=153 num=164 num=171 num=160 [ 3.16227766 7.07106781 8.94427191 9.48683298 95. 115. 195. 265. 50. 50. 50. 3.46410162 151. 240. 50. 50. 148. 159. 166. 155. ]
# PREGUNTA 2: import numpy as np np.random.seed(101) x=np.random.randint(0,100,size=101) print(x) [95 11 81 70 63 87 75 9 77 40 4 63 40 60 92 64 5 12 93 40 49 83 8 29 59 34 44 72 19 10 76 95 87 0 73 8 62 36 83 99 28 63 7 10 52 56 38 73 52 18 71 15 44 0 12 17 75 79 97 93 24 36 63 19 35 30 10 60 20 27 8 86 26 87 46 47 54 86 9 45 2 18 58 92 11 10 94 35 28 3 83 84 47 14 69 60 69 51 6 88]