Reverse list challenge

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

You don’t have to be sorry about asking a question on a learning platform like this one. Most of us are actually newbies trying to learn coding.
Regarding the usage of * and ** in Python, you can read This Article .
I hope you find it useful!

I believe the problem is that you forgot to store the result of arr.reverse() in a variable. try something like “arrReversed = arr.reverse” and then “print(arrReversed)”

Thanks @nibble I will read the article that you suggest me

thanks @Saturna i will try your solution