filmov
tv
Python tutorial - Python exec - Python eval - Differences - How to use exec and eval in python

Показать описание
Free python tutorial for beginners- Mastering Python exec() & eval() Key Differences You Should Know
#python #pythonprogramming #pythontutorial #pythonforbeginners #youtubechannel #pythoninstallationcomplete #pythonhowtoinstall #pythoninstall #pythondownload #pythontutorialfree #pythonyoutube #pythonenglish #pythonenglish #pythonexecvseval #pythonexec()vseval() #pythonexec() #pythoneval() #youtubeviews
Please Captions on - Python in English, Python in Tamil, Python in Telugu, Python in Malayalam, Python in Chinese, Python in Japanese, Python in German, Python in Hindi, Python in French
-------------------------------
hello welcome to technology platform so today we are going to see like what is the main key difference between exec and Avail um so the main key differences like exec it is executing the statements what you mentioned within the parenthesis evalu is like it's only evaluate the X so for example exec Open Bracket if you put like print a 10 plus 10 it will return but here in ever it just only evaluate the expression if you like a valve Open Bracket 10 plus 10 equal to 20 like that it will evaluate the but the main key differences like exec doesn't return the value but a well it should return the value let's see some examples so that uh you can understand the main difference let's see now but the main key difference is like a well this
well less return the value and exec does not return the value now let's see if you are saying that Str equal to 100
nouns evaluation is like just evaluate the expression for example 100 single quotes is mandatory here 100 like 1000 plus Str
if you see this it is evaluating but if you pass this evaluation like this Str equal to 100 this is not an expression it just
error message
if you see this Str
equal to 100
it is not throwing an error message you should have that if you print Str you will get this value for example let's see Str equal to 200 exec Str equal to 500
now just type Str you will get 500 so this is main key difference you cannot pass this kind of value in the evaluation you will get an error message like something like issues it doesn't it doesn't it it won't work so but one more thing is also you can use it let's see how it um works so whether it is returning or not let's see now so returning the values that we want to use for that we are going to use syntaxes like compile
so now yeah well
compile and then Open Bracket and then I'm passing 100 and then some syntax is like string
and then you have to use it exec command inside the evaluation now see this what it written let's see return none now the same thing because as per our understanding exec doesn't return the value but now you can see this so we can say like
code
returns none
now see this eval compile 100
now string
and then passing a well now let's see now
it is compiling and providing evaluating this so it is returning the value so this is what the main key difference you can use it like this as well exec compile 100
then string then you are passing a valve so what it return it should return none because exec should not use it should not return any value let's see this
okay sorry so what it runs yeah so oh sorry code returns 100 because we have uh pass it a value here so this is the main difference let's see one more thing is also we can use it e x e c and then you can use it exec here itself let's see the difference it returns none so here it is a matter what you are passing and what you are compiling so like this the main difference uh between this two and we can see some more examples um let me use it something like that for Loop but but that for Loop we can see it let's see exece print
I can say like
print HDR value like that let me use it like this or print 10 plus 10. I'll use it like this
20. the same like that I will use it 10 plus 10 . it is sorry exec 10 plus 10. it returns none but you should use print then only it it should something written if you see here 10 plus 10 it should return the value 20. so this is the main key difference between execute and event let's see you in the next session bye thanks
#python #pythonprogramming #pythontutorial #pythonforbeginners #youtubechannel #pythoninstallationcomplete #pythonhowtoinstall #pythoninstall #pythondownload #pythontutorialfree #pythonyoutube #pythonenglish #pythonenglish #pythonexecvseval #pythonexec()vseval() #pythonexec() #pythoneval() #youtubeviews
Please Captions on - Python in English, Python in Tamil, Python in Telugu, Python in Malayalam, Python in Chinese, Python in Japanese, Python in German, Python in Hindi, Python in French
-------------------------------
hello welcome to technology platform so today we are going to see like what is the main key difference between exec and Avail um so the main key differences like exec it is executing the statements what you mentioned within the parenthesis evalu is like it's only evaluate the X so for example exec Open Bracket if you put like print a 10 plus 10 it will return but here in ever it just only evaluate the expression if you like a valve Open Bracket 10 plus 10 equal to 20 like that it will evaluate the but the main key differences like exec doesn't return the value but a well it should return the value let's see some examples so that uh you can understand the main difference let's see now but the main key difference is like a well this
well less return the value and exec does not return the value now let's see if you are saying that Str equal to 100
nouns evaluation is like just evaluate the expression for example 100 single quotes is mandatory here 100 like 1000 plus Str
if you see this it is evaluating but if you pass this evaluation like this Str equal to 100 this is not an expression it just
error message
if you see this Str
equal to 100
it is not throwing an error message you should have that if you print Str you will get this value for example let's see Str equal to 200 exec Str equal to 500
now just type Str you will get 500 so this is main key difference you cannot pass this kind of value in the evaluation you will get an error message like something like issues it doesn't it doesn't it it won't work so but one more thing is also you can use it let's see how it um works so whether it is returning or not let's see now so returning the values that we want to use for that we are going to use syntaxes like compile
so now yeah well
compile and then Open Bracket and then I'm passing 100 and then some syntax is like string
and then you have to use it exec command inside the evaluation now see this what it written let's see return none now the same thing because as per our understanding exec doesn't return the value but now you can see this so we can say like
code
returns none
now see this eval compile 100
now string
and then passing a well now let's see now
it is compiling and providing evaluating this so it is returning the value so this is what the main key difference you can use it like this as well exec compile 100
then string then you are passing a valve so what it return it should return none because exec should not use it should not return any value let's see this
okay sorry so what it runs yeah so oh sorry code returns 100 because we have uh pass it a value here so this is the main difference let's see one more thing is also we can use it e x e c and then you can use it exec here itself let's see the difference it returns none so here it is a matter what you are passing and what you are compiling so like this the main difference uh between this two and we can see some more examples um let me use it something like that for Loop but but that for Loop we can see it let's see exece print
I can say like
print HDR value like that let me use it like this or print 10 plus 10. I'll use it like this
20. the same like that I will use it 10 plus 10 . it is sorry exec 10 plus 10. it returns none but you should use print then only it it should something written if you see here 10 plus 10 it should return the value 20. so this is the main key difference between execute and event let's see you in the next session bye thanks