Skip to content
Question 50 of 97

Q.Identify the statement from the following which will raise an error: (A) print("A"*3) (B) print(5*3) (C) print("15" + 3) (D) print("15" + "13")

Odisha ChseCBSE Class XII Board 2024MCQ· 1mImportance★★★★★
52% · 50/97 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Python is strongly typed: it will not add a string and an integer with +. Option (C) print("15" + 3) raises a TypeError; the other three run without error.

The concept: type safety in Python

The + operator behaves differently depending on the operand types:

  • Two numbers perform arithmetic addition.
  • Two strings are concatenated (joined together).
  • A string and a number together raise a TypeError — Python does not guess.

The * operator, by contrast, accepts a string and an integer and repeats the string.

Option-by-option analysis

  1. (A) print("A"*3) — string repetition: "A" repeated 3 times gives AAA. Valid.
  2. (B) print(5*3) — integer multiplication gives 15. Valid. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.