Skip to content

Commit 5d3e013

Browse files
committedAug 3, 2021
uses of math.ceil() function
1 parent 3c460a9 commit 5d3e013

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
 

‎10X/Python/FUNCTION/Modiji.py

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'''
2+
Modiji
3+
Modiji wants to estimate the fund that can be gathered in a month, if he applies a special rule for the funding of covid patients treatments. As per the rule, everyone should pay ceil(7% of their monthly salary) to this scheme.
4+
5+
Given a positive integer n. And the monthly salary of these n people. Help modiji find the fund that can be gathered in a month, through this scheme.
6+
7+
Write a function to do this calculation.
8+
9+
Input
10+
First line contains one integer, denoting n. The next line contains n space seperated integers, denoting the monthly salary of the n people.
11+
12+
Output
13+
One Integer, denoting the result.
14+
15+
Example
16+
Input1:
17+
18+
5
19+
100 200 300 400 555
20+
Output1:
21+
22+
113
23+
24+
'''
25+
import math
26+
n=int(input())
27+
incom=list(input().split())
28+
su=0
29+
for i in range(n):
30+
su+=math.ceil((int(incom[i])*.07))
31+
print(su)

0 commit comments

Comments
 (0)
Please sign in to comment.