How do i find the biggest number that are not in a list?

R Gao

I am trying to make a program that gives you the average, total, and biggest number entered. I am stuck at the biggest number part. My numbers are not in a list, so I don't know how to find the biggest one.

num=0 
total=0 
average=0 
count=0 

while True: 
  num=input("enter a number:")
  num=int(num) 
  if num==-999: 
    break 
  total=total + num
  count=count+1 
  biggest = max(total)

average=total/count 

#print the results
print("the total is:", total)
print("the biggest number is:", biggest)
print("the average is:", average)

I would like it to print the biggest number at the end.

Thanks

Juan Pablo Peveri Rodriguez

Let me share you a solution for your problem. (Take a look at the if clause after the check of the number being "-999"). Feel free to ask if you have any questions! Hope it helps you

num=0 
total=0 
average=0 
count=0
biggest=0 

while True: 
  num=input("enter a number:")
  num=int(num) 
  if num==-999: 
    break
  if num > biggest:
    biggest = num
  total=total + num
  count=count+1 

average=total/count 

#print the results
print("the total is:", total)
print("the biggest number is:", biggest)
print("the average is:", average)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Add number to a list and find the biggest number

From Dev

How do I find the biggest file in a folder and subfolders on the command line?

From Dev

How to find biggest folders (by number of files) in Windows

From Dev

How do I write the code for dividing an even number with biggest equal odd numbers

From Dev

How do I get the "biggest" path?

From Dev

How to find out the biggest number in many documents that contains different numbers

From Dev

Find the biggest prime of a number [Python]

From Dev

How to sort a list with duplicate items by the biggest number of duplicate occurrences - Python

From Dev

Find the biggest change in values in a list?

From Dev

How do I find the next number in a cell?

From Dev

How can I find the biggest magnitude present in a numpy array?

From Dev

Find Biggest Number in C, by N number of inputs

From Dev

How do I find the largest number from a list and its occurrences using lambdas?

From Dev

How can I get a list of the biggest packages currently installed in order?

From Java

How do I get the number of elements in a list?

From Dev

How do I limit the number of values in a list?

From Dev

How do I extract the biggest UID value from /etc/passwd?

From Dev

How do I extract the biggest UID value from /etc/passwd?

From Dev

How to get the biggest number in a file?

From Dev

How to get biggest number in textarea?

From Dev

How to get the biggest number in a file?

From Dev

How do I find the mode of a list<double>?

From Dev

How do I find the mode of a list<double>?

From Dev

C++ Find the biggest number with deque?

From Dev

Comparing 4 variables (integers) & find the biggest number

From Dev

how do i calculate the average number in a list of number

From Dev

How do I check if a number is divisible by every number in a list

From Dev

How do you find the number of occurrence within a list of dictionaries

From Dev

I have a list of strings paired with a number. I want to find the average value for each word that matches to a list of words. How can I do this?

Related Related

  1. 1

    Add number to a list and find the biggest number

  2. 2

    How do I find the biggest file in a folder and subfolders on the command line?

  3. 3

    How to find biggest folders (by number of files) in Windows

  4. 4

    How do I write the code for dividing an even number with biggest equal odd numbers

  5. 5

    How do I get the "biggest" path?

  6. 6

    How to find out the biggest number in many documents that contains different numbers

  7. 7

    Find the biggest prime of a number [Python]

  8. 8

    How to sort a list with duplicate items by the biggest number of duplicate occurrences - Python

  9. 9

    Find the biggest change in values in a list?

  10. 10

    How do I find the next number in a cell?

  11. 11

    How can I find the biggest magnitude present in a numpy array?

  12. 12

    Find Biggest Number in C, by N number of inputs

  13. 13

    How do I find the largest number from a list and its occurrences using lambdas?

  14. 14

    How can I get a list of the biggest packages currently installed in order?

  15. 15

    How do I get the number of elements in a list?

  16. 16

    How do I limit the number of values in a list?

  17. 17

    How do I extract the biggest UID value from /etc/passwd?

  18. 18

    How do I extract the biggest UID value from /etc/passwd?

  19. 19

    How to get the biggest number in a file?

  20. 20

    How to get biggest number in textarea?

  21. 21

    How to get the biggest number in a file?

  22. 22

    How do I find the mode of a list<double>?

  23. 23

    How do I find the mode of a list<double>?

  24. 24

    C++ Find the biggest number with deque?

  25. 25

    Comparing 4 variables (integers) & find the biggest number

  26. 26

    how do i calculate the average number in a list of number

  27. 27

    How do I check if a number is divisible by every number in a list

  28. 28

    How do you find the number of occurrence within a list of dictionaries

  29. 29

    I have a list of strings paired with a number. I want to find the average value for each word that matches to a list of words. How can I do this?

HotTag

Archive