First let us know what is a value and variable?
A variable is something that stores specific value in it.
Now let's look into some basic examples how it works.
variable1 = 10 #line 1
variable2 = 3500 #line2
From the above example,
value is 10, variable name is variable1. Value 10 is stored in variable1.
In the same way variable2 stores a value of 3500.
The name of a variable can be anything but starts with characters or _.
The code below is a simple way of initializing variables.
a1 = 10
_a = 10
The variable name cannot be started with numbers, special characters and blank spaces. The code gives syntax error as shown below.
In the previous post, we initialized variable with only numerical values. Can we store a character, string and floating values in variable? Yes we can store all kind of values in the variable. Let's have a look how we can initialize all types of values. How to initialize a character in python? A value within […] ...
print function is used to print a value, sentence and variable etc. Let's look at some of the examples. output: Hello This is the statement that has to be printed output: 10 M True Other important operations using print function Print a variable and it’s value together. output: the name of the blog is codicious.com […] ...
Welcome to codicious. This is a python programming blog from an Associate Data Scientist. Tutorials, tips, tricks, and opinions about programming, data, and more. The major concepts covered will be on Data Science concepts. But to learn Data science we need to follow the flow mentioned below: ...