Print statement and varriable and its data types
Print statement:
In this blog i am gonna talking about print statement.
So what is print statement. Print is just a function that helps to print any kind of data
examples :
- print("hello world")
- print(12)
- print ("var")
- print (12.5)
" " because this symbol tells that it is a string you don' worry about that i will tell you that what is a string what is an integer, what is a float what is list and etc....
variables:
what is variables. if we try to understand variables are just box that use to different type of values as you seen above to create a variable
you just have to type variablname = value which you want to store
exp :
- a = 1
- b =1.5
- c = "students"
- A variable name must start with a letter or the underscore character
- A variable name cannot start with a number
- 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)
these are some condition let me give you an example of every condition
1, A variable name must start with a letter or the underscore character.
1 . exp -: name = "coadingfighter" here "n" is an alphabet, _name = 3 here the line i have used is known as an underscore.
name = "coadingfighter"
Name = "coadingfighter"
_name = "coadingfighter"
_Name = "coadingfighter"
2 . exp A variable name cannot start with a number
1name = "coadingfighter"(false)
a variable only start with alphoabets and underscore like given above
3. exp A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
a ="value"
_a = "value"
a_ = "value"
a_1 = "value"
a1= "value"
_a1 = "value"
a1_ = "value"
a_1_a = "value"
these alphabets can be capital and you can use how many you want like 1,2,3,10000 there is no limit alphabets to create a variable you can use same alphabets continusely
like : aa ,aab, aabb,
and 4th condition u will learn automatically after writing basic programs. in next post i will discuss about data types thanku
Comments
Post a Comment