Python Variables

  • 2 days ago
DEAR SIR/MADAM, I NEED THIS CHANNEL SPONSORSHIP FROM YOU TOO IF POSSIBLE https://www.dailymotion.com/mokkamodina19

DEAR SIR/MADAM, PLEASE ACCEPT AND PERMISSION DAILY MOTION, VIMEO AND RUMBLE.COM IN BANGLADESH.
Mohammad Ali Ashraf, [6/29/2024 7:07 PM]
https://ea.ebs.bankofchina.com/contactUs_en.html

ashrafm703@gmail.com IS MY EMAIL AND
DEAR SIR/MADAM, I NEED SUPPORT AND LOAN FROM CHINESE PRESIDENT AND GOVT.

DEAR SIR/MADAM, I WANT LOAN FROM YOU TO LEARN AND EARN MONEY BY THE SUPER AFFILIATE MARKETING OF JOHN CRESTANI.

DEAR SIR/MADAM.I AM FROM BANGLADESH MY PAYONEER ID IS mokkamodina19@gmail.com , IN ANY BANK ACCOUNTS OF BANGLADESH IS NOT SAFE FOR MY MONEY YOU KNOW THAT. WILL PAYONEER BANK ACCOUNTS OF MINE WILL BE SAFE FOR MY MONEY.? ALL OF MY ASSETS OR PROPERTIES ARE SEIZED BY FAKE WAYS IN BANGLADESH. I WANT TO LOAN FROM YOU TO BUY READYMADE HOUSES OR HOMES FOR ME. ALSO NEED LOANS FROM YOU WORK OR JOB VISA FOR USA/CANADA. ALSO NEED LOAN FROM YOU TO SETTLE AND STUDY IN THE USA/CANADA.. I WANT TO HANDOVER ALL OF MY ASSETS OR PROPERTIES WHICH ARE SEIZED BY FAKE WAYS TO THE USA/CANADA UNIVERSITIES.

https://www.aiddata.org/how-china-lends

mokkamodina19@gmail.com is my payoneer id. i want my youtube channel sponsorship from you.https://www.youtube.com/channel/UCrNbtmpYbyYMgmzD9aPtGMQ
and also help me to monetize my tiktok https://www.tiktok.com/@mohammadaliashr3


AFTER MONETIZATION I WANT THIS LINK SPONSORSHIP FROM YOU TOO. https://rutube.ru/channel/37901720/ ,,,,mokkamodina19@gmail.com is my payoneer id.
Transcript
00:00of f. So, in the output here you can see the beginning the first 800 it comes for the first
00:12and the second line of the statement ok. You are assigned the value of f as 800 you are
00:19printing the value of f here. So, that is the first 800.
00:23Now, you see you are defining some function for the global f and you are asking to print
00:30the value of f. So, again the first value of f will be declared that is the second 800
00:36which is appearing here on the screen ok. Now, you are secondly you are assigning the
00:43value of f to some other statement. For example, here is change of global variable that is
00:49from 800 it is coming to change of global variable. You are ending the function and
00:56you are asking them to print the function of the print the value of f. So, that is when
01:02the change of global variable appears. So, this is how the global and variable function
01:08local and global variable works. It could be altered in any way you want you can declare
01:15it inside the function, outside the function and that is where the local and global variable
01:21stands.
01:22Now, how do you delete a variable? We can delete python variable using the command del
01:30ok and the variable name. So, basically this is how you can delete you can print you can
01:37use the function del and the particular variable or something that you want to delete. So,
01:43we have an example we deleted for example, if I write a program and I want to delete
01:49the variable g ok. So, we I can say del g and definitely that will be deleted. So, this
01:57is how it is I am assigning a value for example, g is equal to 24 ok. I am asking them to print
02:03the value of g. Later on I am asking them to delete the value of g and then the and
02:09then to print the value of g. So, you can see 24 has been declared because
02:16I am asking them to print the value of g and then I am asking them to delete the value
02:21of g. So, that is when you will find an error command called as trace back because you are
02:26deleting the value of g and you are getting this error called name error name g is not
02:32defined because you are asking them to print the value of g and plus you are at the same
02:37time you are asking them to delete the value of g. So, that is when you get this kind of
02:42output where g is not defined. So, these are all some examples you can just
02:48install pycharm you can implement your own simple codes like this try to run it for your
02:54better understanding of how local and global variable work, how you can delete, how you
02:59can declare variables, how you can reuse variable. So, with this you can understand the basics
03:04of the how programming of python language works for this pycharm.
03:10With this I conclude this session. Thank you so much.
03:14Thank you so much.
03:34Hello everyone. Welcome to this session about Python variable. We will be learning how we
03:39are using different types of variables, data types and how the values can be stored or
03:46reused all these kind of functions we will be learning here in this lesson.
03:51So, basically coming to the introductory part about variable a python variable is a reserved
03:58memory location which helps us to store values and the next is about the python variable
04:05type. Now, every value in a python has a data type. So, different data types that are
04:11available in python here you can see as numbers, list, tuples, then strings, dictionary etcetera
04:19all these are variables in python that can be declared by a name, by a alphabet etcetera.
04:26Now, how to declare and use a variable? Basically we are declaring a variable say example x,
04:33y, tall depends and then you are assigning a value to it that is how you declare and
04:40assign a value to a variable. Now, re-declaring a variable is nothing but even if you in a
04:46program if you have used a variable say a and you have assigned a value to that variable
04:53a after some time after some path of that program or after some function if you want
04:59to reuse it, it is possible. So, these are some of the main things that you need to understand
05:05about the python variable. Now, I will later on in the coming slides you will understand
05:10how I have structured the declaring using of the variable and even reusing of the variable.
05:17So, now this is basically about declaring a variable. Now, what I have done here is
05:23I have taken a variable a and I have assigned a variable called 5000 a value to that particular
05:30variable say 5000. Now, I am assigning a value to that variable and I am asking the program
05:39to print the value of that variable. So, if a is equal to 5000 here which is a variable
05:47a and I am asking to print the value of a you are getting the output as 5000 that is
05:55you are declaring a variable, you are assigning a variable and you are printing the value
06:00of a. So, this is just a basic example of how you declare a variable.
06:06Now, coming to the next session that is re-declaring of the variable ok. Again now I am taking
06:13the variable a here ok I have assigned the value 5000 to the variable a. Now, what I
06:20am doing is I am printing that particular value of a. So, this is the first part here
06:26a is equal to 5000 you are printing the value of a. So, definitely 5000 has been given as
06:35output. Now, again you are reusing the same variable that is a is being used again and
06:42you are assigning something to that a. So, here I am using dollars and I am asking to
06:49print that particular a. So, definitely 5000 and dollars would be printed as output. So,
06:56this is how you can reuse or re-declare the variable.
07:01Now, coming to the next section that is Python string concatenation and variables. So, basically
07:07concatenation is you are combining the two words or strings or anything together. So,
07:13now, I am assigning two variables here that is a and b. So, for a I am assigning one value
07:21for b I am assigning other value and I am asking the function here concatenation function
07:28here to be operated and to print them together. So, for that I am using print function of
07:35the variable a plus the string that is the value of b. So, Grishma and 88 when it is
07:44concatenated together when you are asking the print function of a plus b you are getting
07:50Grishma 88. So, this is how the concatenation program works.
07:56Now, what is local and global variable? When we want to use the same variable for the rest
08:04of the program or a module we declare it as a global variable. For example, on our previous
08:11program we were declaring a single variable a ok. So, that has been assigned as a global
08:18variable because you are reusing it. So, when we want to use the same variable for the rest
08:24of the program we are declaring it as a global variable. When we want to use the variable
08:30in a specific function or a method we call it a local variable. So, when you want to
08:37use that particular variable for a particular function or a method under some function or
08:43method we mention it as local variable. So, now let us define a variable in python
08:50where the variable f is global in scope and we are assigning a value 800 and we are asking
08:58it to print the output. So, this you can see in upcoming slides. Now, variable f is again
09:04declared in a function and we can use it as assume or we can assume it as local scope. So,
09:12where you give something for example, I have given I love learning python. So, this is used
09:18as a local part local variable and then we are getting it as an output. So, let us see how it
09:25looks like. So, now here f I am taking a variable f I am assigning the value 800 to it and I am
09:33asking the print function to print the value of f. So, now that is the globalized here f is used
09:42as a global function. Now, when I am using it under some function or some method that f becomes
09:50a local variable. So, now define I am defining some function here that is a function here and
09:56I am stating f is equal to I love learning python. So, you are printing basically only the value of
10:04f that is assigned as a local variable and then again after the function ends you are asking them
10:11to print the function of f which has been assigned for a global variable. So, that is why in the
10:19output here you can see 800 printed twice because I am using the print function twice here. At the
10:27beginning stage I am asking the print f function again. So, that the f variable can be declared
10:33again and after the function has ended where the function is working for I love learning python
10:40after that function has ended I am again asking them to declare the value of f which has been
10:46previously assigned. So, that is how you get 800 twice and the local variable f that is I love
10:53learning python has been printed as local variable of f. So, this is one of the example here. Now,
11:02while python variable declare declaration using the low keyword global we can even reference the
11:09global variable inside a function. So, do not assume that one if you are using a variable inside
11:16the function it is local and one that is not there in the function it is global. No, there could be
11:21scenarios where the global function or the variable can be even declared globally inside a function.
11:28The variable f is global in scope and is assigned a value 800 which is printed in output ok. Now,
11:35variable f declared using keyword global this is not a local variables, but the same global
11:42variable declared earlier. Hence, we print its value the output as 800. Now, we change the value
11:50of f inside the function once the function call is over the change value of the variable f persist
11:58ok. So, this is again another example of how the global variable can be used inside a function. So,
12:05you can see the function here ok. I am taking the variable f here which is assigned 800 and I am
12:13printing that function f ok. I am printing the value of the variable f. Now, I am using some
12:21function here ok and I am asking them to print the value of f again. Why? Because it is because
12:30it has been declared global. So, then I am assigning one more value for the variable f
12:36that is change of global variable and I am asking them to print the function of f.
12:42So, in the output here you can see the beginning the first 800 it comes for the first and the
12:50second line of the statement ok. You are assigned the value of f as 800 you are printing the value
12:57of f here. So, that is the first 800. Now, you see you are defining some function ok for the
13:04global f and you are asking to print the value of f. So, again the first value of f will be declared
13:11that is the second 800 which is appearing here on the screen ok. Now, you are secondly you are
13:19assigning the value of f to somebody.