NEED CODING HELP - MUST BE COMPATABLE WITH PYTHON/JUPYTER NOTEBOOK 12. Explain t
ID: 3755704 • Letter: N
Question
NEED CODING HELP - MUST BE COMPATABLE WITH PYTHON/JUPYTER NOTEBOOK
12. Explain the result of each line: type (42) type (42.0) 2.0') type("42.0") type("" "42.0""") type([1, 21) type([1] [2]) type(1 2) type (print)Explanation / Answer
type(42) -> 42 is an int. so, result of this line is int type(42.0) -> 42.0 is a float. so, result of this line is float type('42.0')) -> '42.0' is a str. so, result of this line is str type("42.0")) -> "42.0" is a str. so, result of this line is str type("""42.0"""))-> """42.0""" is a str. so, result of this line is str type([1, 2])) -> [1, 2] is a list. so, result of this line is list type([1] + [2]))-> Adding two lists gives a list. so, result of this line is list type(1 + 2)) -> Adding two ints gives an int. so, result of this line is int type(print)) -> print is a builtin function. so, result of this line is builtin_function_or_method
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.