0
0
Intro to Computingfundamentals~10 mins

Software licensing basics in Intro to Computing - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print the type of software license.

Intro to Computing
license_type = "GPL"
print("The license is [1]")
Drag options to blanks, or click blank then click option'
AGPL
B"license_type"
Clicense
Dlicense_type
Attempts:
3 left
💡 Hint
Common Mistakes
Using quotes around the variable name, which prints the name instead of its value.
2fill in blank
medium

Complete the code to check if the license is 'MIT'.

Intro to Computing
if license == [1]:
    print("License is MIT")
Drag options to blanks, or click blank then click option'
A"MIT"
BMIT
C'GPL'
Dlicense
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting quotes around string literals causing errors or wrong comparisons.
3fill in blank
hard

Fix the error in the code to print 'Free software' if license is 'GPL'.

Intro to Computing
if license == [1]:
    print("Free software")
Drag options to blanks, or click blank then click option'
A'MIT'
BGPL
C"GPL"
Dlicense
Attempts:
3 left
💡 Hint
Common Mistakes
Using the variable name without quotes causing a NameError.
4fill in blank
hard

Fill the blank to create a dictionary of licenses and their types.

Intro to Computing
licenses = [1]
Drag options to blanks, or click blank then click option'
A"MIT"
B{"GPL": "Open Source", "Windows": "Proprietary"}
C"Proprietary"
D"Open Source"
Attempts:
3 left
💡 Hint
Common Mistakes
Not using curly braces or missing quotes around strings.
5fill in blank
hard

Fill all three blanks to filter licenses that are Open Source.

Intro to Computing
open_source = {k: v for k, v in licenses.items() if v [1] [2]
print(open_source.get([3], "Not found"))
Drag options to blanks, or click blank then click option'
A==
B"Open Source"
C"MIT"
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong comparison operators or wrong keys in get().