About using starred expressions alone. Yes, it's possible. For example, instead of assigning a variable to a list directly, you can do it with a range():
*data,=range(1,11)
This will produce a list of numbers from 1 to 10. You need to use comma, otherwise you'll get a range object instead of a list. It happens because Python gets comma as a syntax for creating a tuple, not (), so it's a syntactic rule that you cannot create a tuple of one item without using a comma. So, this (1) is an integer for Python, and this (1,) or this 1, is a tuple.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
About using starred expressions alone. Yes, it's possible. For example, instead of assigning a variable to a list directly, you can do it with a
range()
:This will produce a list of numbers from 1 to 10. You need to use comma, otherwise you'll get a range object instead of a list. It happens because Python gets comma as a syntax for creating a tuple, not
()
, so it's a syntactic rule that you cannot create a tuple of one item without using a comma. So, this(1)
is an integer for Python, and this(1,)
or this1,
is a tuple.