
Post


@PythonPr 1. The function func_x(x) is called with "python" as an argument.
2. Inside the function:
x = x + '2' → "python" + "2" results in "python2".
x = x * 2 → "python2" * 2 results in "python2python2".
3. The function returns "python2python2".
Correct answer:
C. python2python2
English

@PythonPr Ans is python2python2
Within the function x is a local variable.
First, python concatenated with 2, resulting in python2.
Then, "python2" is multiplied by 2 which repeats the string, giving python2python2.
English

@PythonPr C
python is a string and same is 2 in line 2. Therefore, line 2 concatenates python & 2. Line 3 multiplies it two times, thus output is python2python2
English

@PythonPr I first guessed it was A. Error. But, after trying, I know it's C. python2python2. I'm new to Python. It's weird because a number plus (+) a string will raise an Error but multiplication is accepted.
English

@PythonPr Guys help me how to get recognized….i am doing #100DaysOfCode
English

@PythonPr Option C: python2ython2
Since for 1st time concatenating 2 strings i.e. python and 2 and then in the next line multiplying string
English




























