What does the following statement mean? num1. num2 = get_num()

What does the next assertion imply?
num1, num2 = get_num() a. The operate get_num() is anticipated to return a worth every for
num1 and num2.
b. The operate get_num() is anticipated to return a worth and assign
it to num1 and num2.
c. Assertion will trigger a syntax error.
d. Assertion will trigger a run-time error. Clarify all the alternatives. Why true and why false? Why is the
reply not c? It provides me an error after I strive the code within the c
choice.

Reply
:
a. The operate get_num() is anticipated to return a worth every for
num1 and num2.
Clarification
:
b. The operate get_num() is anticipated to return a worth and
assign it to num1 and num2.
WRONG
Purpose : num1 and num2 each require values.

c. Assertion will trigger a syntax error.
d. Assertion will trigger a run-time error.
It is not going to trigger a syntax or run time error.

Please remark
beneath if in case you have any queries.
Please do give a thumbs up should you preferred the reply thanks

Also Read :   Qual a tinta tonalizante de cabelo que não contém chumbo ?

1 2 3 4 def get_num(): return 1 numi, num2 = get_num() print(num1, num2) Traceback (most up-to-date name final): File “program.py”, line 3, in num1, num2 = get_num() TypeError: can not unpack non-iterable int object
1 2 3 4 def get_num(): return 1,2 num1, num2 = get_num() print(num1, num2) 1 2 [Finished in 0.15]
What does the following statement mean?
num1, num2 = get_num()
a. The function get_num() is expected to return a value each for
num1 and num2.
b. The function get_num() is expected to return a value and assign
it to num1 and num2.
c. Statement will cause a syntax error.
d. Statement will cause a run-time error.
Explain all the choices. Why true and why false? Why is the
answer not c? It gives me an error when I try the code in the c
option. What does the following statement mean?
num1, num2 = get_num()
a. The function get_num() is expected to return a value each for
num1 and num2.
b. The function get_num() is expected to return a value and assign
it to num1 and num2.
c. Statement will cause a syntax error.
d. Statement will cause a run-time error.
Explain all the choices. Why true and why false? Why is the
answer not c? It gives me an error when I try the code in the c
option.

Leave a Comment