What is the difference between literal and variables in Python? -


i'm beginner user python, confused between literal , variables.

this know literal: "a"+"b"

and variables: sentence="a"+"b"

a literal notation representing fixed (const) value.
variable storage location associated symbolic name (pointed to, if you'd like).

it's best explained in use:

foo = bar(42) ^     ^   ^ |     |   |--- literal, 42 *literally* 42 |     |------- function, represents "something" in memory |------------- variable, named "foo", , content may vary (is variable) 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -