Answer to Question #306569 in Python for babu

Question #306569

question: Cards Game


There are M people from 1 to M . Andy has N cards with her. Starting with person Z , he gives the cards one by one to the people in the numbering order. Z, Z+1, Z+2,.....,M, 1, 2,....Z-1. Your task is to output the number of the person who will get the last card.


input 1:- 3 3 2

output 1:- 1

input 2 :- 1 100 1

output 2:- 1


1
Expert's answer
2022-03-06T14:04:55-0500
def dist_card(M, N, Z):
    list1 = []
    for i in range(1, M + 1):
        list1.append(i)
    print(list1[Z + N])

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