Python shows different data type for seemingly similar inputs.
While assigning a value to a variable like this, I get a tuple:
>>> x = 1,
>>> <class 'tuple'>
However when I do the same thing in the following way, it shows a different data type:
>>> <class 'int'>
How and why do these two differ from each other?
When you put a comma after 1 you have created a tuple with one item only.
So x is a tuple in your example
For more info read: Create Tuple With One Item
type(1,) I cannot explain.
Google and Youtube is useful.
PSA: I’m shutting down this forum so please direct future help requests to the Discord or firstname.lastname@example.org.