Jun-08-2020, 12:44 PM
(This post was last modified: Jun-08-2020, 12:44 PM by melifaro09.)
Hi, you have hier two cycles on the same values:
i=1 my_list = [] while i <=10: try: my_list.append(int(input('please enter your discussions scores: '))) i += 1 except: print('you made an error,please try again') print(my_list) l=[] for x in my_list: dis_score = x * (2/100) l.append(dis_score) print('your total percentage from discussion scores is: '+ str(sum(l)))they can be combined into one:
my_list = [] l = [] for i in range(10): try: x = int(input('please enter your discussions scores: ')) my_list.append(x) l.append(x * (2/100)) except: print('you made an error,please try again') print(my_list) print('your total percentage from discussion scores is: '+ str(sum(l)))The same thing can be done with the following two loops on my_list2 and s