Bir şey yapmaya çalışıyorum (kabul edilir) basit. Eğer bir işlev veya bir tamsayı ise bir satırını almak için işlevimi istiyorum, bir
#The starting values of count (total number of numbers)
#and total (total value of all the numbers)
count = 0
total = 0
while True:
number = input("Please give me a number: ")
#the first check, to see if the loop should be exited
if number == ("done"):
print("We are now exiting the loop")
break
#the idea is that if the value is an integer, they are to be counted, whereas
#anything else would display in the error message
try:
int(number)
count = count + 1
total = total + number
continue
except:
print("That is not a number!")
continue
#when exiting the code the program prints all the values it has accumulated thus far
avarage = total/count
print("Count: ", count)
print("Total: ", total)
print("Avarage: ", avarage)
, öyle görünüyor (+ 1'e saymak = saymak) ve (+ toplam = toplam 1), ama neden göremiyorsunuz değilim. Herhangi bir yardım büyük beğeni topluyor.