Bird
0
0

You want to write a Python program that prints your name and age on separate lines. Which code will do this correctly?

hard📝 Application Q8 of 15
Python - Basics and Execution Environment
You want to write a Python program that prints your name and age on separate lines. Which code will do this correctly?
Aprint("Name: John Age: 25")
Bprint("Name: John", "Age: 25")
Cprint("Name: John" + "Age: 25")
Dprint("Name: John") print("Age: 25")
Step-by-Step Solution
Solution:
  1. Step 1: Understand printing on separate lines

    Using two print() statements prints each on its own line.
  2. Step 2: Analyze each option's output

    print("Name: John") print("Age: 25") prints name and age on separate lines; others print on one line.
  3. Final Answer:

    print("Name: John")\nprint("Age: 25") -> Option D
  4. Quick Check:

    Separate print() calls = separate lines [OK]
Quick Trick: Use multiple print() calls for multiple lines [OK]
Common Mistakes:
MISTAKES
  • Using one print with commas for new lines
  • Concatenating strings without spaces
  • Expecting + to add new lines

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Python Quizzes