Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to assign the correct file extension for a text document.
Intro to Computing
file_name = "document" + [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing an extension for audio or images instead of text.
✗ Incorrect
The .txt extension is used for plain text files.
2fill in blank
mediumComplete the code to assign the correct file extension for an image file.
Intro to Computing
image_file = "photo" + [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing image extensions with video or document extensions.
✗ Incorrect
The .jpg extension is commonly used for image files.
3fill in blank
hardFix the error in the code by choosing the correct file extension for an audio file.
Intro to Computing
audio_file = "song" + [1]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using image or executable file extensions for audio files.
✗ Incorrect
The .mp3 extension is used for audio files like songs.
4fill in blank
hardFill both blanks to create a dictionary mapping file types to their common extensions.
Intro to Computing
file_extensions = {"text": [1], "image": [2] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing audio or executable extensions with text or image types.
✗ Incorrect
Text files use .txt and image files use .jpg extensions.
5fill in blank
hardFill all three blanks to create a dictionary mapping file types to their extensions, including audio files.
Intro to Computing
file_types = {"text": [1], "audio": [2], "image": [3] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing executable extensions with file type extensions.
✗ Incorrect
Text files use .txt, audio files use .mp3, and image files use .jpg.