Answer to Question #265196 in Python for SANJAY

Question #265196

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++




1
Expert's answer
2021-11-12T17:29:47-0500
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)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS