Post

@PythonPr B) 1010
The key: "10" is a string, not a number!
› String * integer = repetition
› "10" * 2 repeats "10" twice
› Result: "1010" (not 20!)
For beginners: Quotes = text mode. Want 20? Use the value without quotes.
English

@PythonPr Answer: B) 1010
Reason:
a is a string ("10"), not a number.
In Python, multiplying a string by an integer repeats the string.
English

@PythonPr Answer: B — 1010
In Python, "10" is a string. When a string is multiplied by an integer, Python repeats the string instead of doing arithmetic.
So "10" * 2 results in "1010"
English

@PythonPr B) 1010 is the right ✅️
Here a is the string not a list, so this is work like string multiplication.
English

@PythonPr a is a string
b is an integer
In Python, string × integer = string repetition
output= 1010
English

@PythonPr 1010✅
In Python, when a string is multiplied by a int, that string is repeated.
"10" * 2 → "10" + "10" → "1010"
English

@PythonPr Answer: B (1010)
Because a is a string, so Python repeats it b times instead of doing multiplication.
English

@PythonPr (C) Error
Explanation: String can't be multiplied.
English





























