The question is to consider the following function definition:
def read_value_type(prompt='Enter a Boolean> ', convert=bool):
val = input(prompt)
return convert(val)
as a multiple choice:
val = read_value_type(convert=bool, prompt='Enter a boolean>')val = read_value_type(prompt='Enter a float> ')val = read_value_type()
and it is asked which of the above are valid calls to read_value_type?
Since none display errors, and seem to be reading, I was wondering whether the three of them would call the function or not?
All of them. But second will return bool, not float.