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/
Nesta página do site você pode assistir ao vídeo on-line Use of eval() in Python - Python eval function - int() vs eval() in Python - Python Programming duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Learn Computer 17 Fevereiro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 21,505 vezes e gostou 618 espectadores. Boa visualização!