Use of eval() in Python - Python eval function - int() vs eval() in Python - Python Programming

preview_player
Показать описание
We always use int () in python to covert string to integer. like
x=int(input("Enter No 1:"))
y=int(input("Enter No 2:"))
z=x+y
print("Sum:",z)

we can use eval() also in place of int() like
x=eval(input("Enter No 1:"))
y=eval(input("Enter No 2:"))
z=x+y
print("Sum:",z)

in this video we clear the doubt students faces between int() vs eval(). Use of eval() in Python will make python code more versatile. Python eval function returns value which you want like integer , float, list, tuple etc. in Python Programming all must clear the use of eval(). in short if you want to read multiple values use eval function in python.

visit website :
Рекомендации по теме
Комментарии
Автор

Beautiful explanation though it could have been better if all was explained in English I can feel I missed half of your work on this video

mzamoshabalala
Автор

knowing that you can learn all topics soo quickly on this channel is such so relief 🙏👌👌

supanpreetkaur
Автор

very well explain..even our teach have doubt on this topic....salute sir

examdepartment
Автор

Very well m student of IIT and very confused when learn about list copy ...today I clear each and everything.... master thanks

jaspreetsinghbhogal
Автор

Many books I searched this topic.. Many sites.. All wasted
But this video makes this so simple....

vimalmishra
Автор

Thank u sir. Your videos are very underrated. I wanna see your channel grow

ratduckerreplacedwithf
Автор

Again master piece very good explanation

kuberroadlines
Автор

thank you for clear the diff between eval and int

avinashdube
Автор

explained in a very easy and simplified way

shumiroy
Автор

Wow you're explanation is super duper hit 🫡🎉

kimmuskan
Автор

why do you use english title? you think all people in youtube is from your background?

Iamexalted