Jul-21-2020, 04:01 AM
print(int("100.0"))it is type error, how is it value error?
Type Error or Value Error?
|
Jul-21-2020, 04:01 AM
print(int("100.0"))it is type error, how is it value error?
Jul-21-2020, 04:08 AM
Execute the statement and see what exception pops up.
Jul-21-2020, 04:10 AM
@deanhystad I saw that it says value error but I feel that for whatever value of the float, it will give the error and not just some of the values, so it should be type error?
Jul-21-2020, 04:56 AM
int(arg) accepts strings as an argument, so it is not going to be a type error, no matter what is contained in the string. int(list) is a type error because list is not a valid argument type.
|
|