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/
In questa pagina del sito puoi guardare il video online Use of eval() in Python - Python eval function - int() vs eval() in Python - Python Programming della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Learn Computer 17 febbraio 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 21,505 volte e gli è piaciuto 618 spettatori. Buona visione!