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 :
https://anacondapython.com/
На этой странице сайта вы можете посмотреть видео онлайн Use of eval() in Python - Python eval function - int() vs eval() in Python - Python Programming длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Learn Computer 17 Февраль 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 21,505 раз и оно понравилось 618 зрителям. Приятного просмотра!