Answer
4
5
22
4
4
Error due to leading zeros in eval statement
Work Step by Step
int(value): it's a type conversion to int and because the value is a float, it can be changed to an int by truncating the float, hence it becomes 4
round(value): it's a float and can be rounded up making the answer 5
eval("4 * 5 + 2"): the statement is syntactically correct because it has a mathematical expression. it's evaluated as (4*5) which is 20 + 2 = 22
int("04"): because the string is a number, type conversion is valid
int("4.5"): because the string is a number, type conversion is valid and the float is truncated, making the answer 4
eval("04")": this is not a mathematical expression and because there are leading zeros, it is syntactically incorrect