SHARE
TWEET

Untitled

a guest Sep 12th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. def program():
  4.  
  5.     list = []
  6.     tall = -1
  7.  
  8.     while(tall != 0):
  9.  
  10.         nytall = int(input("Skriv tall: "))
  11.         tall = nytall
  12.         if(tall == 0):
  13.             continue
  14.         list.append(nytall)
  15.  
  16.     for x in list:
  17.         print(x);
  18.  
  19.     minSum = 0
  20.     for x in list:
  21.         minSum += x
  22.  
  23.     print(minSum)
  24.  
  25.     minst = list[0]
  26.  
  27.     storst = list[0]
  28.  
  29.     for x in list:
  30.         if x < minst:
  31.             minst = x
  32.    
  33.  
  34.     for x in list:
  35.         if x > storst:
  36.             storst = x
  37.  
  38.     print("Storst: " + str(storst))
  39.  
  40.     print("Minst: " + str(minst))
  41.  
  42.  
  43. program()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top