Computer Science, asked by realabhizz, 6 months ago

What is the difference between
eval(input()) and input().​

Answers

Answered by sunanditaudayasankar
3

Answer:

Eval evaluates a piece of code. input gets a string from user input. Therefore:

Eval(input()) evaluates whatever the user enters. If the user enters 123, the result will be a number, if they enter "foo" it will be a string, if they enter ?wrfs, it will raise an error.

Eval("input()") evaluates the string "input()", which causes Python to execute the input function. This asks the user for a string (and nothing else), which is while 123 will be the string "123", ?wrfs will be the string "?wrfs", and "foo" will be the string '"foo"' (!).

Eval(eval("input()")) is exactly identical to eval(input()).

hope this was helpful and if it was please mark me as the brainliest.

Answered by sushrutkhadse8
0

Answer:

ajsjj

Explanation:

ajsjj

subscribe my channel Plane spotting India

Similar questions