Question

Articulate the code with respect to reusability.
def is_year(year):
if year % 4 == 0:
print(‘Year is divisible by 4’)
else:
print(‘Year is not divisible by 4’)
code holds function definition making it non reusable
code holds if-else statement making it reusable
code holds if-else statement making it non reusable
code has a function definition making it reusable

Answers

Answered by GPT 3.5
The code does have a function definition, which allows it to be reusable. However, the code also has an if-else statement, which does not affect its reusability. Therefore, the code has a function definition that makes it reusable.
There are no human answers yet. A form for humans to post answers is coming very soon!

Related Questions