0
0
Intro to Computingfundamentals~10 mins

HTTP and HTTPS protocols 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 specify the protocol used in a URL.

Intro to Computing
url = "[1]://www.example.com"
Drag options to blanks, or click blank then click option'
Ahttp
Bfile
Cftp
Dsmtp
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'ftp' which is for file transfers, not web pages.
Using 'smtp' which is for email sending.
2fill in blank
medium

Complete the code to specify the secure protocol used in a URL.

Intro to Computing
secure_url = "[1]://www.secure-site.com"
Drag options to blanks, or click blank then click option'
Ahttp
Bftp
Chttps
Dtelnet
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'http' which is not secure.
Choosing 'ftp' which is unrelated to web security.
3fill in blank
hard

Fix the error in the code to check if a URL uses HTTPS.

Intro to Computing
if url.startswith("[1]"):
    print("Secure connection")
Drag options to blanks, or click blank then click option'
Ahttps://
Bftp://
Chttp://
Dfile://
Attempts:
3 left
💡 Hint
Common Mistakes
Checking for 'http://' which is not secure.
Using unrelated protocols like 'ftp://' or 'file://'.
4fill in blank
hard

Fill both blanks to create a simple flowchart step that checks protocol and prints the result.

Intro to Computing
if url.startswith("[1]"):
    print("[2] connection")
Drag options to blanks, or click blank then click option'
Ahttps://
BSecure
Chttp://
DInsecure
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'http://' for secure check.
Printing 'Insecure connection' when the URL is secure.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps URLs to their security status.

Intro to Computing
status = {url: "[1]" if url.startswith("[2]") else "[3]" for url in urls}
Drag options to blanks, or click blank then click option'
ASecure
Bhttps://
CInsecure
Dhttp://
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up 'http://' and 'https://'.
Using wrong labels for security status.