What is the expected output of the following code?
What is the expected output of the following code?
A
>>> def f(n): ... if n==1: ... return'1' ... return str(n)+f(n-1) ... >>> print(f(2)) 21
answer: A. 21
The answers in the dumps are good to remember! The bulk of the exam questions are from these exam dumps. The questions with mistakes in them or missing : etc are in the exam but in the correct answer form, do remember the correct answers as well as the answers with the mistakes in the coding. There are a few questions that are slightly different but you can find the answers from the previous or next question/answers! Hope this helps!
A is correct