0% found this document useful (0 votes)
5 views2 pages

Movie Earnings and Employee Salaries

The document contains a Python test with three questions. The first question involves calculating total earnings for movies and identifying the highest earning movie. The second question focuses on filtering employees by department, calculating total salary expenses for the IT department, and sorting employees by salary, while the third question requires counting occurrences of a specific element in a list.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Movie Earnings and Employee Salaries

The document contains a Python test with three questions. The first question involves calculating total earnings for movies and identifying the highest earning movie. The second question focuses on filtering employees by department, calculating total salary expenses for the IT department, and sorting employees by salary, while the third question requires counting occurrences of a specific element in a list.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Test

Question 1 :
Movie Name
Tickets Sold
Price Per Ticket
Calculate:

Total earnings for each movie


Movie with the highest earnings

movies = [
["Avengers", 500, 10],
["Inception", 300, 12],
["Titanic", 400, 8]
]

Output:- Total Earnings: [['Avengers', 5000], ['Inception', 3600], ['Titanic', 3200]]


Highest Earning Movie: ['Avengers', 5000]

Question 2:-
Name
Department
Salary
Write a program to:

Filter employees by department


Find the total salary expense for the IT department
Sort employees by salary in descending order

employees = [
["Alice", "HR", 50000],
["Bob", "IT", 75000],
["Charlie", "Sales", 60000],
["David", "IT", 80000],
["Eve", "Finance", 70000]

Output:- IT Department Employees: [['Bob', 'IT', 75000], ['David', 'IT', 80000]]


Total IT Salary: 155000
Employees Sorted by Salary: [['David', 'IT', 80000], ['Bob', 'IT', 75000],
['Eve', 'Finance', 70000], ['Charlie', 'Sales', 60000], ['Alice', 'HR', 50000]]

Question 3:- [1,2,3,True,(1,'s'),4,[1,2,1,3]]*2


Count 1 occurrence

You might also like