2. Suppose the university has decided to announce bonus 1 PMS point to employees those have PMS points more than 7. The appraisal will be based on PMS points. We have an array of employees with UID and PMS point . Display the list of employees those would be benefited with bonus. The bonus should be added to the employees who have UID and PMS through the concept of list comprehension.
Input Format ->The input should contain list of employees with UID and PMS point. Output Format ->For each test case, display the UID and PMS point after bonus is being added.
I HAVE ASKED THIS QUESTION EARLIER ALSO BUT IT WAS BEING SOLVED IN C++ BUT I WANT THIS SOLUTION IN PYTHON NOT IN C++
PLEASE SOLVE IT USING PYTHON NOT C++
lst = [ ]
#Taking an integer as an length of the list
n = int(input("Enter number of elements : "))
counter = 0
for i in range(0, n):
counter = counter + 1
ele = [input("Give UID {0}: ".format(counter)), int(input("Give PMS{0}: ".format(counter)))]
lst.append(ele)
print("Current list of UID and PMS:", lst)
for i in lst:
if i[1] > 7:
i[1] = i[1] + 1
print("Updated UID and PMS:", lst)
Comments
Leave a comment