-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.py
More file actions
45 lines (37 loc) · 1.22 KB
/
program.py
File metadata and controls
45 lines (37 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# my_list = [["Adam", 4, 7, 9, 10],
# ["Catherine", 10, 8, 1, 9],
# ["John", 10, 9, 7, 7],
# ["Pedro", 10, 9, 7.5, 9],
# ["Wanda", 9, 6.5, 4.5, 10]]
# sum= 0
# for t in range(len(my_list)):
# size= len(my_list[t])
# for i in range(size):
# print(my_list[i][0],end=': ')
# for j in range(size-1):
# num= my_list[i][j+1]
# sum+=num
# edemidiong=sum/(size-1)
# print(f'{edemidiong:.2f}')
# # print('')
# sum= 0
# def sumAvg(text, search):
# if not search in text:
# return(f'The line of text provided doesn’t contain the character ‘{search}’')
# else:
# numbers= '01123456789'
# sum= 0
# digit_amount= 0
# for i in list(text):
# if i in numbers:
# sum+=int(i)
# digit_amount+=1
# avg= sum/digit_amount
# return(f'The sum of the digits is {sum}\nThe average is {avg:.2f}')
# if __name__ == '__main__':
# my_string= input('Enter the string: ').lower()
# search_char= input('Give me the search character: ').lower()
# # length= len(my_string)
# # print(length)
# print(sumAvg(my_string,search_char))
print(sum(2,1))