← Programming questions
Easy / PYTHON

Positive and Even

python_basics · control_flow 5 minute study target

Not completed

Challenge

Implement positive_and_even(a) for an integer a. Return the exact string "satisfactory" if a is strictly positive and even. Otherwise return "unsatisfactory". Zero is not positive.

Target complexity: O(1)

Return values are checked by type. Use the exact function name. Print output is not your answer. Tests have time and memory limits.

Public examples

Example 1

Arguments

[3]

Expected return

unsatisfactory
Example 2

Arguments

[4]

Expected return

satisfactory
Hint

Match the return value and type to the contract.

The worked solution unlocks after completion, or with Premium access.

positive_and_even.pyPython 3.12

Drafts are saved to your account, not to shared browser storage.

Sign in to submit code and save progress.

Results

Your results will appear here.

Hidden tests reveal only their pass/fail status, never their inputs or expected outputs. Runtime is observed wall time—not an inferred complexity class.

© 2026 EverythingQuant. All Rights Reserved.