a = input('enter yor grade: ') jam=0 count = 0 while int(a) != -1: jam = jam + int(a) count = count +1 a = input('enter your grade: ') print('The AVERAGE is ' , jam/count)
input1 = input('Type your number (or -1 to stop): ') adad = int(input1) sum = 0 count = 0 while adad != -1: sum += adad count += 1 input2 = input("Type your number (or -1 to stop): ") adad = int(input2) if adad == 0: break if count != 0: print('Average:', sum / count) else: print('Keine Zahlen eingegeben.')
count = 0 jam = 0 x = int(input('enter your number: ')) while int(x) != -1: count = count + 1 print ("count= ", count) jam = jam + x print ('jam= ', jam) x = int(input('type your number: ')) average = jam / count if x == -1: break print ('jam= ', jam) print ('count= ', count) print ('average= ',average)
Con = 0 AVG = 0 Sum = 0 Num = 0 while Num != -1: Num = int (input ('Pls Enter Your Poin : ')) Con +=1 Sum = Sum + Num if Con == 10: break AVG = Sum / Con print ('Cont Your Points is : ' , Con) print ('Your Points Avarage is :', AVG)
sum=0 count=0 addad=input("addad mad nazar khod ra vared konid:") number=int(addad) while number!=-1: sum=sum+number print(sum) count=count+1 print(count) addad=input("addad mad nazar khod ra vared konid:") number=int(addad) avrage=sum/count print('miangin ta in lahze barabar ba=',avrage,'mibashad')
i=0 total=0 count=0 average=0 while i != -1: i = float(input("Enter a number: ")) total= i + total count= count+1 print(total , count) if i == -1: break print("you enter -1 and -1 to stop") if count > 0: average = total / count print("The average of the entered numbers is:" , {average})
number = int(input("Enter a number: ")) counter = 0 Sum = 0 while number != -1: print("Your number is: ", number) counter += 1 Sum += number print("count: ", counter, "sum of numbers: ", Sum) number = int(input("Enter a number: ")) average = Sum / counter print("average is: ", average)
javab tamrin ba kami taghirat dar daryaft javab print('!!Hello!!') tedad = 0 jam = 0 a = int(input('please enter a number for average Measurement accuracy (1 for round sum average And 2 for exact number average(other numbers will be rounded)): ')) number = int(input('enter a number: ')) while int((number != -1)): tedad = tedad + 1 jam = jam + number number = int(input( 'enter a number: ' )) if (tedad > 10): if (a == 1): print( 'avrage' , '=' , jam // tedad ) if (a == 2): print( 'average' , '=' , jam / tedad ) else: break print( 'average' , '=' , jam // tedad )
sum = 0 number = 0 count = 0 while number != -1: number = float(input('Enter your number: ')) sum = sum + number print(sum) if number == -1: sum = sum - (-1) average = sum / count else: count = count + 1 average = sum / count
print(average) with for: count1 = 0 sum = 0 m = int(input("Enter the itiration number: ")) for number in range(0, m): number = float(input('Enter your number: ')) count1 = count1 + 1 sum = sum + number #print(sum) if number == -1: break average = sum / count1 print(average)
counter = 0 number = 0 total=0 while number != -1: number=input() number = int(number) total = total + number counter= counter + 1 else: print((total-number)/counter)
thanks you are the best:)
Thanks!
a = input('enter yor grade: ')
jam=0
count = 0
while int(a) != -1:
jam = jam + int(a)
count = count +1
a = input('enter your grade: ')
print('The AVERAGE is ' , jam/count)
Perfect❤❤
input1 = input('Type your number (or -1 to stop): ')
adad = int(input1)
sum = 0
count = 0
while adad != -1:
sum += adad
count += 1
input2 = input("Type your number (or -1 to stop): ")
adad = int(input2)
if adad == 0:
break
if count != 0:
print('Average:', sum / count)
else:
print('Keine Zahlen eingegeben.')
num=int(input('type your number: '))
sum=0
count=0
while num!=-1:
sum=sum+num
count=count+1
num=int(input('type your number: '))
print('average', sum/count)
count = 0
jam = 0
x = int(input('enter your number: '))
while int(x) != -1:
count = count + 1
print ("count= ", count)
jam = jam + x
print ('jam= ', jam)
x = int(input('type your number: '))
average = jam / count
if x == -1:
break
print ('jam= ', jam)
print ('count= ', count)
print ('average= ',average)
بهتره از حلقه بینهایت استفاده کنید
استاد کاش حل تمرین رو هم میزاشتین
بله همینطوره
Con = 0
AVG = 0
Sum = 0
Num = 0
while Num != -1:
Num = int (input ('Pls Enter Your Poin : '))
Con +=1
Sum = Sum + Num
if Con == 10:
break
AVG = Sum / Con
print ('Cont Your Points is : ' , Con)
print ('Your Points Avarage is :', AVG)
sum=0
count=0
addad=input("addad mad nazar khod ra vared konid:")
number=int(addad)
while number!=-1:
sum=sum+number
print(sum)
count=count+1
print(count)
addad=input("addad mad nazar khod ra vared konid:")
number=int(addad)
avrage=sum/count
print('miangin ta in lahze barabar ba=',avrage,'mibashad')
Count = 0
Jam = 0
Adad = int(input('enter your numnbers:'))
while Adad != -1:
Jam = Jam + Adad
Count = Count +1
print ('Sum is:',Jam)
print ('Count is:',Count)
Adad = int(input('enter your numnbers:'))
Mean = Jam/Count
print('Mean is:',Mean)
جادی یجوری میگه که حس میکنی قراره خیلی پیچیده باشه
i=0
total=0
count=0
average=0
while i != -1:
i = float(input("Enter a number: "))
total= i + total
count= count+1
print(total , count)
if i == -1:
break
print("you enter -1 and -1 to stop")
if count > 0:
average = total / count
print("The average of the entered numbers is:" , {average})
inp = int(input("Enter your numer : "))
jam_adad = 0
tedad_adad = 0
while inp != -1:
jam_adad = inp + jam_adad
tedad_adad += 1
inp = int(input("Enter your numer : "))
miangin = jam_adad/tedad_adad
print(miangin)
number = int(input("Enter a number: "))
counter = 0
Sum = 0
while number != -1:
print("Your number is: ", number)
counter += 1
Sum += number
print("count: ", counter, "sum of numbers: ", Sum)
number = int(input("Enter a number: "))
average = Sum / counter
print("average is: ", average)
یعنی ما حلقه ( ; ; )for که توی زبانای دیگه هست رو نداریم. حلقه های معمولی از while و حلقه های رشته ای از for پس forech نداریم.
Very good 💯
javab tamrin ba kami taghirat dar daryaft javab
print('!!Hello!!')
tedad = 0
jam = 0
a = int(input('please enter a number for average Measurement accuracy (1 for round sum average And 2 for exact number average(other numbers will be rounded)): '))
number = int(input('enter a number: '))
while int((number != -1)):
tedad = tedad + 1
jam = jam + number
number = int(input( 'enter a number: ' ))
if (tedad > 10):
if (a == 1):
print( 'avrage' , '=' , jam // tedad )
if (a == 2):
print( 'average' , '=' , jam / tedad )
else:
break
print( 'average' , '=' , jam // tedad )
سلام شما میدونید چطور میشه دیباگ رو تو خود کنسول وی اس کد اجرا کرد مثل تو کلیپ بجای اینکه بره تو ترمینال وی اس کد دی باگ کنه؟
چرا مستقیما نمیگیم مثلا یک تا صد رو پرینت کن میایم کارو بزرگش میکنیم for میاریم😭؟
sum = 0
number = 0
count = 0
while number != -1:
number = float(input('Enter your number: '))
sum = sum + number
print(sum)
if number == -1:
sum = sum - (-1)
average = sum / count
else:
count = count + 1
average = sum / count
print(average)
with for:
count1 = 0
sum = 0
m = int(input("Enter the itiration number: "))
for number in range(0, m):
number = float(input('Enter your number: '))
count1 = count1 + 1
sum = sum + number
#print(sum)
if number == -1:
break
average = sum / count1
print(average)
Jadi best
هر موقع خواستم یه زبان برنامه نویسی شروع کنم قدم اولم این بود که ببینم hello world
چطوری چاپ کنم روی نمایشگر قدم بعدی نوشتن
For
بود!!!!!!!!!😂😂😂😂
thanks Jadi
x = 0
y = 0
soval = input ('adadet chie?')
soval = int (soval)
while soval != -1:
x = x + soval
print (y)
y = y + 1
soval = input ('adadet chie?')
soval = int (soval)
if soval == -1:
print ('hah hah hah')
print (x / y)
بدون if هم میشه
دمت گرم داداشم
میشه توضیحش بدید؟
count = 0
sum = 0
Adad = int(input('enter number: '))
while Adad != -1:
sum = sum + Adad
count = count + 1
mean = sum/count
print ('Sum is: ',sum)
print ('Count is: ',count)
Adad = int(input('enter numnber:'))
print ('Sum is: ',sum)
print ('Count is: ',count)
print('Mean is: ',mean)
اینجا چرا باید دوباره Adad رو بنویسیم تو خط های اخر
none to second😍
counter = 0
number = 0
total=0
while number != -1:
number=input()
number = int(number)
total = total + number
counter= counter + 1
else:
print((total-number)/counter)
❤❤
❤❤❤❤❤❤
❤❤❤❤❤❤❤