Guruh talabasi Baratboyev Jamshidning python basics va oop fanidan bajargan 2-moduli Savol


Download 150.6 Kb.
Sana14.05.2023
Hajmi150.6 Kb.
#1459257
Bog'liq
Jamshid 2 modul Python


111 20 guruh talabasi Baratboyev Jamshidning PYTHON BASICS VA OOP fanidan bajargan 2-moduli
Savol:

Javoblari:
#2-masala
# n=100
#
# x=[0]*n
# y=[0]*n
#
# x[0]=y[0]=1
#
# s=0
# for i in range(1, n):
# x[i]=.3*x[i-1]
# y[i]=x[i-1]+y[i-1]
# s+=x[i]/(1+abs(y[i]))
#
# print(s)

#3-masala


n=100

x=[0]*n


x[0]=x[1]=x[2]=1

s=0
for i in range(4,n):


x[i]=x[i-1]-x[i-3]
s+=x[i]/2**i

print(s)

Download 150.6 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling