Python Basics & Variables
Python-
Python is a high level programming language.
Python is scripting language.
It is an interpreted language.
It is easy to use.
What is Scripting Language:-
Scripting Language is a language where we create scripts(series of commands) and those scripts are interpreted only in runtime.
What is Interpreted language:-
Interpreted language that checks the error line by line and shows it during the writing of program.
# Printing the statements
print("Helloworld!!")
#Multiple words variables??
camelCase, PascalCase, snake_case
-> snake_case is recommended.
#Assigning multiple variables
x,y,z = "Anna","Bhawa","Chandra"
friends = []
friends = x,y,z
print(friends)
#Output
["Anna","Bhawa","Chandra"]
#Variables Play
a = "Ashish"
b = 10
print(a+b) #Not Possible, Two values with same data type can only be added.
#Global Variable
Variables that are created outside the function is called global variables.
globalVariable = "is added"
def func():
print("the global variable" + globalVariable)
func()
#Output
the global variable is added
Comments
Post a Comment