Hi,
I trying some challenge on HackerRank with Python and I developed this code :
import math
import os
import random
import re
import sys
def print_reverse_number(n,arr):
arr = []
n = int(input())
for i in range(0,n):
element_input = int(input())
arr.append(element_input)
arr.reverse()
print(arr)
if __name__ == '__main__':
n = int(input())
arr = list(map(int, input().rstrip().split()))
print_reverse_number(n, arr)
but doesn’t work and I ask my problem on Python’s forum and someone show me this solution:
print(*reversed(lst), sep=' ')
but I don’t understand the "*reversed(lst) " and I saw the documentation but there isn’t nothing about *reversed there is only reversed method.
Sorry for my dumb question and thanks,
CamCode