0
0
Intro to Computingfundamentals~10 mins

Safe browsing habits 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 check if a website URL starts with a secure protocol.

Intro to Computing
if url.startswith([1]):
    print("Secure connection")
Drag options to blanks, or click blank then click option'
A"https://"
B"http://"
C"ftp://"
D"file://"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'http://' instead of 'https://'
Confusing other protocols like 'ftp://'
2fill in blank
medium

Complete the code to block access to a list of unsafe websites.

Intro to Computing
if website in [1]:
    print("Access blocked")
Drag options to blanks, or click blank then click option'
Atrusted_sites
Bsafe_sites
Cunsafe_sites
Dfavorite_sites
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'safe_sites' which is the opposite
Using unrelated lists like 'favorite_sites'
3fill in blank
hard

Fix the error in the code that warns about suspicious links.

Intro to Computing
if 'http://' [1] url:
    print("Warning: Suspicious link")
Drag options to blanks, or click blank then click option'
Ain
Bnot in
C==
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' which checks equality
Using 'not in' which reverses the logic
4fill in blank
hard

Fill both blanks to create a dictionary of websites with their safety status.

Intro to Computing
site_status = {site: [1] for site in websites if site [2] unsafe_sites}
Drag options to blanks, or click blank then click option'
Asite.upper()
Bsite.lower()
Cin
Dnot in
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'site.upper()' which changes case incorrectly
Using 'in' which includes unsafe sites
5fill in blank
hard

Fill all three blanks to filter and map safe websites with their URL lengths.

Intro to Computing
safe_lengths = [1]: len([2]) for [3] in websites if [2] not in unsafe_sites}
Drag options to blanks, or click blank then click option'
Asite
Burl
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing variable names causing errors
Using 'url' inconsistently