Q.Which of the following is a valid keyword in Python?
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 →The only valid Python keyword among the options is return, as false, non_local, and none are either incorrectly cased or misspelled versions of actual keywords.
Python keywords are special reserved words that have specific meanings and purposes in the language. They cannot be used as identifiers (like variable names, function names, or class names) because they are integral to Python's syntax and structure. Understanding keywords is fundamental to writing correct and readable Python code.
The core idea here is to identify which of the given strings is an exact match for one of Python's reserved keywords, paying close attention to spelling and case sensitivity. Python is a case-sensitive language, meaning False is different from false, and None is different from none.
-
Understanding Python Keywords:
Python has a fixed set of keywords. These words are reserved by the language and cannot be used for any other purpose, such as naming variables or functions. They are essential for defining the structure and logic of Python programs. For example,
if,else,for,while,def,class,import,return,True,False,Noneare all keywords. -
Analyzing Option (a)
false:The string
falseis not a valid keyword in Python. Python usesFalse(with a capital 'F') as a keyword to represent the boolean value for falsity. Because Python is case-sensitive,false(lowercase 'f') is treated as a regular identifier, not a keyword.Watch outPython keywords are case-sensitive.
falseis not the same asFalse. Similarly,trueis not the same asTrue, andnoneis not the same asNone. -
Analyzing Option (b)
return:The string
returnis a valid keyword in Python. It is used within functions to send a value back to the caller and to exit the function's execution.def function_name(parameters):# function bodyreturn value -
Analyzing Option (c)
non_local: …
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.