JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Album Upload
Share
Explore
Gallery
Solution Album Upload
Solution Album Upload
Solution
The Task
Array info
Pseudocode
Python Starter Code
Code Clips
Python Starter Code
Copy and paste the code below into your
main.py
file before you begin the task.
# Abum Upload
import
time
# prints blank line
print
(
'\n'
)
# GET album name
# GET number of songs
# Declare song title array
songTitle
=
[
None
]
*
numSongs
# REPEAT for number of songs on album
for
i
in
range
(
0
,
len
(
songTitle
)
,
1
)
:
# GET song title
songTitle
[
i
]
=
input
(
'Enter song title : '
)
# END REPEAT
# displays a blank line
# display uploading message
print
(
'We are uploading your entry...'
)
# pauses program for 3 seconds
time
.
sleep
(
3
)
# clears the screen
print
(
'\033[H\033[2J'
)
# displays a blank lines
print
(
'\n\n'
)
# DISPLAY album name
# DISPLAY number of songs
# displays a blank line
print
(
'\n'
)
# REPEAT for number of songs on album
for
i
in
range
(
0
,
len
(
songTitle
)
,
1
)
:
# DISPLAY the song number and the song title
print
(
str
(
i
+
1
)
+
': '
+
songTitle
[
i
]
)
# END REPEAT
# displays a blank line
# DISPLAY upload complete message
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.