+ 2

What are python literals?

Just to clarify, python literals are the right hand side of the equation right? So for example, x = 123 123 is the literal right?

1st Dec 2021, 6:50 AM
Mario
Mario - avatar
1 Respuesta
+ 11
literals in python are data values that can be assigned to a variable. they can be string literals, numerical literals, boolean literals or collection literals. for your sample you are right: 123 is an integer literal.
1st Dec 2021, 7:23 AM
Lothar
Lothar - avatar