-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPractice8.py
30 lines (24 loc) · 1.03 KB
/
Practice8.py
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
# Programer Name: Ani Ohanian
# Date:8/13/22
# Description: This program declares two empty lists one is for name and one for salaries.
# Within the for loop ask for employees name and their salaries and append them into the list accordingly.
# Find out the total salary using accumulation concept but you need to call a function called EvaluateSalary()
# within the for loop passing the argument salary for each iteration.
# Output : Both of the lists with their items and the total salary.
employeeName = []
employeeSalaries = []
totalSalary = 0
numberOfEmployee = int(input("Please enter for how many employees are you asking: "))
def EvaluateSalary(salary):
global totalSalary
totalSalary += salary
return totalSalary
for employee in range(numberOfEmployee):
name = input("Please enter your name: ")
salary = float(input("Please enter your salary: "))
employeeName.append(name)
employeeSalaries.append(salary)
result = EvaluateSalary(salary)
print(employeeName)
print(employeeSalaries)
print(round(result,2))