Advertisement
PowerCell46

Snowballs Python

Dec 24th, 2022
1,279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.02 KB | None | 0 0
  1. import math
  2.  
  3. number_of_snowballs = int(input())
  4. weight_list = []
  5. time_needed_list = []
  6. quality_list = []
  7. calculation_list = []
  8. while True:
  9.     number_of_snowballs -= 1
  10.     if number_of_snowballs == -1:
  11.         break
  12.     weight_of_the_snowball = int(input())
  13.     weight_list.append(weight_of_the_snowball)
  14.  
  15.     time_needed = int(input())
  16.     time_needed_list.append(time_needed)
  17.  
  18.     quality_of_the_snowball = int(input())
  19.     quality_list.append(quality_of_the_snowball)
  20.  
  21.     calculation = (weight_of_the_snowball / time_needed) ** quality_of_the_snowball
  22.     calculation_list.append(calculation)
  23.  
  24. biggest_number = -99999999999
  25.  
  26. for index in range(0, len(calculation_list)):
  27.     current_grade = calculation_list[index]
  28.     if current_grade > biggest_number:
  29.         biggest_number = current_grade
  30. searched_index = calculation_list.index(biggest_number)
  31.  
  32. print(f'{weight_list[searched_index]} : {time_needed_list[searched_index]} = {math.trunc(calculation_list[searched_index])} ({quality_list[searched_index]})')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement