Python - Basics and Execution EnvironmentYou 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")Check Answer
Step-by-Step SolutionSolution:Step 1: Understand printing on separate linesUsing two print() statements prints each on its own line.Step 2: Analyze each option's outputprint("Name: John") print("Age: 25") prints name and age on separate lines; others print on one line.Final Answer:print("Name: John")\nprint("Age: 25") -> Option DQuick Check:Separate print() calls = separate lines [OK]Quick Trick: Use multiple print() calls for multiple lines [OK]Common Mistakes:MISTAKESUsing one print with commas for new linesConcatenating strings without spacesExpecting + to add new lines
Master "Basics and Execution Environment" in Python9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Python Quizzes Conditional Statements - Elif ladder execution - Quiz 13medium For Loop - For–else execution behavior - Quiz 2easy Python Basics and Execution Environment - What is Python - Quiz 4medium Variables and Dynamic Typing - Type checking using type() - Quiz 9hard Variables and Dynamic Typing - Type conversion (int, float, string) - Quiz 7medium Variables and Dynamic Typing - Type checking using type() - Quiz 4medium Variables and Dynamic Typing - Dynamic typing in Python - Quiz 11easy While Loop - Counter-based while loop - Quiz 3easy While Loop - Counter-based while loop - Quiz 12easy While Loop - Why while loop is needed - Quiz 6medium