A group of people are playing a game.They are standing and each carring a card with a number on it.These numbers in the list A. A random number S iis selected.
Find out the new list of numbers after
Sample Input1
1,2,3
1
Sample Output1
2 3
1 2
string = input("Enter card numbers separated with ',':\n")
list = string.split(",")
S = input("Enter the number of removed people: ")
S = int(S)
left = " ".join(list[S:])
right = " ".join(list[:len(list) - S])
print("Removed from the left: ", left)
print("Removed from the right: ", right)
Comments
Leave a comment