Python 2.7 - defining functions - provide missing blanks Can someone please prov
ID: 3809960 • Letter: P
Question
Python 2.7 - defining functions - provide missing blanks
Can someone please provide the missing ******* blanks please
Complete the blanks in the following Python code so that it prints "Gates open at 12 noon."
def doable(afford, busy, age):
return ******* and not ******** and age ******** 18
def big_question(cash):
cashed_up = cash > 100
studying = False
age = 20
if doable(cashed_up, studying, age):
print "Gates open at 12 noon."
else:
print "Another time maybe."
big_question(200)
Explanation / Answer
Answer:afford and not busy and age > 18
def doable(afford, busy, age):
return afford and not busy and age > 18
def big_question(cash):
cashed_up = cash > 100
studying = False
age = 20
if doable(cashed_up, studying, age):
print("Gates open at 12 noon.")
else:
print ("Another time maybe.")
big_question(200)
Output:
sh-4.3$ python3 main.py
Gates open at 12 noon.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.