JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Input-Output
Share
Explore
Gallery
Solution Input-Output
Solution Input-Output
Solution
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.
import
time
# displays a blank line
print
(
'\n'
)
# DISPLAY welcome message
print
(
'Welcome - Let\'s create your profile'
)
# displays a blank line
print
(
'\n'
)
# ---- INPUT Section ----
# GETS name from user
name
=
input
(
'Please enter your name: '
)
# GETS year of birth from user
yearBorn
=
int
(
input
(
'Please enter the year you were born: '
)
)
# Get the age from the use
# Get
# ---- OUTPUT Section ----
# displays a blank line
print
(
'\n\n'
)
# DISPLAY creating profile message
print
(
'Creating profile...'
)
# pauses program for 3 seconds
time
.
sleep
(
3
)
# clears screen
print
(
'\033[H\033[2J'
)
# displays a blank line
print
(
'\n'
)
# DISPLAY profile created message
print
(
"New Profile Created"
)
print
(
"==================="
)
# displays a blank line
print
(
'\n'
)
# DISPLAY name
print
(
"Name: "
+
name
)
# DISPLAY year of birth
print
(
"Year Born: "
+
str
(
yearBorn
)
)
# DISPLAY
# DISPLAY
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.