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
S people were removed from the left.
S people were removed from the right.
Sample Input1
1,2,3
1
Sample Output1
2 3
1 2
1
Expert's answer
2022-04-13T09:01:35-0400
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)
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments