daily pastebin goal
7%
SHARE
TWEET

oops1

gruntfutuk Jun 13th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def my_functions():
  2.     """ weekly sales """
  3.     """ compute sales from input list """
  4.    
  5. sales_number=int(input('Enter todays sales: '))
  6. toy_sales=[]
  7. count=0
  8.    
  9. for sales_number in toy_sales:  # toy_sales is empty, so loop will never execute  
  10.     toy_sales.append(int(sales_number))  # sales_number is already an integer
  11.     highest = max(sales_number)  # sales number is just one integer so
  12.     lowest = min(sales_number)   # max() and min() aren't valid - need a list
  13.    
  14.     if sales_number.isdigit():  # sales_number is an integer, isdigit() is for strings
  15.      toy_sales=toy_sales.isdigit()  # this is not valid, toy_sales is a list, isdigit()
  16.                                     # is used on strings and returns True or False
  17.        
  18.     # this line is incorrect needs adjustment        
  19.     elif(toy_sales)==sales_number:  # invalid, trying to compare a list with an integer
  20.    
  21.         highest = max(toy_sales) # this would work if toy_sales was a populated
  22.         lowest = min(toy_sales)  # as above
  23.          
  24. print("Your Highest Number is: " + str(highest))
  25.  
  26. print("Your Lowest Number is: " + str(lowest))
  27. main()  # function main isn't defined
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