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 is selected.
Find out the new list of numbers after
Sample Input1
1,2,3
1
Sample Output1
2 3
1 2
import random
print('Enter numbers in the list A (sep. ","): ', end='')
A = input().split(',')
# if need manual enter random number S
# print('Enter random number S: ', end='')
# S = int(input())
S = random.randint(1, len(A)-1)
print(f'Random number S: {S}')
for i in range(S, len(A)):
print(A[i], end=' ')
print()
for i in range(0, len(A)-S):
print(A[i], end=' ')
Comments
Leave a comment