Solution:
The question asks about an
advantage of Python. An advantage is something that makes Python good or easy to use compared to other programming languages.
Correct Answer: Option C: It has a large standard library
This is the correct answer because Python comes with a
huge collection of pre-written code called the "standard library". Think of it like a toolbox that comes packed with all sorts of useful tools already inside.
Want to work with files? There's a tool for that. Want to work with dates and times? There's a tool for that. Want to send emails or build a website? There are tools for those too!
This means you don't have to write everything from scratch, which
saves a lot of time and effort when you're building programs. It makes Python very powerful and versatile for many different types of projects.
Why other options are incorrect:
Option A: It compiles to machine code
Python is what we call an
"interpreted" language, not a traditionally "compiled" one like C++ or Java (which has its own way of compiling).
When you run Python code, an "interpreter" program reads your code line by line and executes it directly. It doesn't first turn your entire program into a machine-readable file (called "machine code") before running it. While Python does convert code into something called "bytecode" internally, this isn't the same as compiling directly to machine code, which is usually faster for execution but less flexible for development. So, this is not an advantage in the way the option implies.
Option B: It enforces strict typing
Python uses something called
"dynamic typing". This means you don't have to explicitly tell Python what *type* of data a variable will hold (like "this variable will store a number" or "this variable will store text"). Python figures out the type of data as your program runs.
"Strict typing" usually refers to languages where you *must* declare variable types, and the system strictly enforces them before the program even runs. Python's dynamic typing is often seen as an advantage for its flexibility and speed of development, but "strict typing" is not a characteristic of Python.
Option D: It requires extensive memory management
This is actually the
opposite of the truth for Python!
Python has
"automatic memory management". This means you, as the programmer, generally don't need to worry about telling the computer when to free up memory after you're done using variables or objects. Python handles all of that automatically in the background using a process called "garbage collection".
This is a huge advantage because it prevents common programming errors related to memory and makes Python much easier to learn and use compared to languages like C++ where you often have to manage memory manually. So, "requiring extensive memory management" would be a disadvantage, not an advantage, and Python avoids it.