0:00
Hello and welcome. In today's video we are going to learn how to assign values in Python
0:08
Let's delete this code first and write here a variable called name and assign it a value like this
0:30
In Python, the assignment operator is an equal sign like this. We use this equal sign. When you
0:40
write name is equal to sunjib, it means name is a variable or a container where we put a value
0:52
it's a string value and we'll learn about string later. Shunjib. Right
0:59
And on the other hand, if we want to assign an integer value
1:05
the variable num is assigned to 12 or a fraction then we can assign this value to this variable frac or
1:20
assign a boolean value true or false to this variable or this container
1:30
Now this is the string value. What is a string? A string is an addition of characters
1:38
String is like a garland of characters. S A N J I B
1:45
And they have been added here as a string. Right. So, Shunjib, which is nothing more than 1, 2, 3, 4, 5, 6 characters
1:59
So, we can also add them separately with the plus sign. let us take a printout of this value separately. Since each
2:19
container is now assigned to a certain value Every container or every variable is considered to have a type and an id Let see
2:49
Let's run the program and see the output now. The output is quite naturally print is
2:59
shunjib, name is shunjib and it belongs to a class called str that means string and it has
3:10
a certain ID. On the other hand the number or integer 12 belongs to class integer has a certain
3:18
ID. True is another variable container and it belongs to a class bool or
3:28
boolean with a certain ID Prac another variable belongs to class float or floating value fraction represent fraction and has a certain ID What does that mean It means that in Python
3:45
everything is an object that means every behind every variable or container
3:51
whatever you want to call it has a class behind it right. It's an object
3:59
oriented programming concepts and we will discuss it later elaborately so don't worry about it. We'll
4:07
show you how object oriented programming works in Python and how this class works by default in
4:14
Python. So just keep this in mind that Python, in Python everything is an object and Python is an
4:24
object-oriented programming language and the real proof is that every variable belongs to a class. So in the next video we'll see more coming in this lesson
4:41
In the next video we'll see more about variables, objects and values. Till then
4:46
goodbye, stay safe and take care