JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Athletics Scotland with starter code
Share
Explore
Gallery
Athletics Scotland with starter code
Athletics Scotland with starter code
The Task
Pseudocode
Python Starter Code
CodeClips
Python Starter Code
Copy and paste the code below into your
main.py
file before you begin the task.
# Athletics Scotland
# ==================
import
time
# display title and sports on offer
print
(
'\n'
)
print
(
' ATHLETICS SCOTLAND '
)
print
(
'===================='
)
print
(
'\n'
)
print
(
'Sports on offer to watch:'
)
print
(
'- 100m Sprint'
)
print
(
'- Relay'
)
print
(
'- Hurdles'
)
print
(
'- Long Jump'
)
print
(
'\n\n'
)
# get sport from user
sport
=
input
(
'Which sport are you going to see: '
)
# get number of tickets from user
numberOfTickets
=
int
(
input
(
'Number of Tickets: '
)
)
print
(
'\n'
)
print
(
'Processing order...'
)
# pauses screen for 3 seconds
time
.
sleep
(
3
)
# clears screen
print
(
'\033[H\033[2J'
)
print
(
'\n\n'
)
# get user name
fullName
=
input
(
'Enter next full name: '
)
# display ticket details
print
(
'\n'
)
print
(
'-------------------------------------'
)
print
(
'Athletics Scotland - Grand Prix Event'
)
print
(
'Sport: '
+
sport
)
print
(
'Full name: '
+
fullName
)
print
(
'-------------------------------------'
)
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.