Answer to Question #297474 in Python for Ram

Question #297474

Number Game


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-02-15T13:59:10-0500
test_list = [1,2,3]


print("Original list is : " + str(test_list))


test_list.pop(0)
test_list.pop(-1)


print("Modified list is : " + str(test_list))


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