Suppose there is a room in the office and X people enter room throughout the day, Y people leave throughout the day [continuously people are entering the room, some are staying there, and rest are going out] .. so tell me the code to calculate how many people are there in that room at the EOD..?
Code to calculate the number of people in a room at EOD given X people enter and Y people leave throughout the day.
Use a variable to keep track of the number of people in the room at any given time.
In...read more
Code to calculate number of people in a room at EOD given X enter and Y leave throughout the day.
Create a variable to keep track of the current number of people in the room
Increment the variable by X ...read more
def calculate_people_at_eod(people_enter, people_leave):
current_people_count = 0
# Assuming the length of people_enter and people_leave lists are the same
for i in range(len(people_enter)):
current_p...read more
Create a variable to keep track of the current number of people in the room
Increment the variable by X every time someone enters the room
Decrement the variable by Y every time someone leaves the room
R...read more
Top Deloitte Data Analyst interview questions & answers
Popular interview questions of Data Analyst
Top HR questions asked in Deloitte Data Analyst
Reviews
Interviews
Salaries
Users/Month