JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Debug 5.4. Birthday Boolean with starter code
Share
Explore
Gallery
Debug 5.4. Birthday Boolean with starter code
Debug 5.4. Birthday Boolean with starter code
The Task
Python Starter Code
Code Clips
Python Starter Code
Copy and paste the code below into your
main.py
file before you begin the task.
# print out a blank line
print
(
'\n'
)
# ask the user if today is their birthday (true or flase) answer
birthday
=
bool
(
int
(
input
(
'Is today your birthday, 1-True or 0-False? '
)
)
)
# print out a blank line
print
(
'\n'
)
# checks the user response
# if it is true it will display Happy Birthday.
# otherwise display good wishes message.
if
birthday
=
False
:
print
(
"Happy Birthday!"
)
print
(
"Hope you have the best day"
)
else
:
print
(
"Have a great day when it comes."
)
# print out a blank line
print
(
'\n'
)
Gallery
Share
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.