Variables are nothing but reserved memory locations to store values.
Python has no command for declaring a variable, unlike any programming language.
variable is created the moment you first assign a value to it.
For example-
x = 5
y = "John"
print(x)
print(y)
Variable Naming convention :
Variable name must starts with letter or underscore.
Variable name cannot start with numbers or any special characters.
A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
Variable names are case-sensitive (age, Age and AGE are three different variables)
Python uses the + character To combine both text and a variable:
Example-
x = "awesome"
print("Python is " + x)
We can also use the + character to add a variable to another variable:
x = "Python is "
y = "awesome"
z = x + y
print(z)
We cannot combine string and numbers, python will generate error, like following code does :
Example
x = 5
y = "John"
print(x + y)
Python allows you to assign a single value to several variables simultaneously. For example −
a = b = c = 1
a = b = c = 1, 2, "john"
Python has five standard data types −
Numbers
String
List
Tuple
Dictionary
All data types we will cover in comming blogs.
Congratulations @anand1! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Award for the number of comments
Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard!
Participate in the SteemitBoard World Cup Contest!
Collect World Cup badges and win free SBD
Support the Gold Sponsors of the contest: @good-karma and @lukestokes
i am following you. plz share your review about my post and follow me and comment
https://steemit.com/mgsc/@ananttomar007/john-mcafee-says-he-has-been-poisoned-and-tells-culprits-you-will-soon-understand-the-true-meaning-of-wrath
You have a minor misspelling in the following sentence:
It should be coming instead of comming.It's natural Because i am human not a bot like you