Username and password

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Username and password

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. What does a username do?
A It identifies who you are
B It proves it is really you
2. What does a password do?
A It tells people your name
B It proves it is really you
3. Which one is okay to share with friends?
A Your password
B Your username
4. Your friend asks for your password so they can play your game. What should you do?
A Keep it secret and say no
B Share it because they are your friend
5. Which statement is true?
A A password should be kept secret
B A password is shown to everyone

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1username: sam_k7 AProves it is really you. It is kept secret, which is why it is hidden with stars when you type it.
2password: ******** BLogging in needs both a username to identify you and a password to prove it. A password alone is not enough.
3Logging in uses both a username to say who you are and a password to prove it Clogin(username, password)
4You should never share your password with anyone DIdentifies who you are. It is okay to share it, because it only says which account is yours.
5Keep my username secret. Tell my friend my password. EThis is backwards. The username can be shared, but the password is the secret that must never be shared.
6login(password) // no username Fshare(password) -> NEVER

Definitions

username and password

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
________ = "sam99"
2.
________ = input("Enter your secret: ")
3.
login(________, password)
4.
canShareUsername = ____
5.
if password __ savedPassword: print("Logged in")

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A username = "sam_k
B password = "Blue!Tree42"
C login(username, password)
Question 2
A username = "mia_7"
B password = "Red$Moon9"
C login(username, password)
D print("Welcome " + usernam)
Question 3
A username = "sam_k"
B password = "Blue!42"
C if password == "Blue!42":
D print("Logged in"
Question 4
A username = "leo_9"
B password = "Sun#Hat77"
C print("Username: " + password)
D login(username, password)
Question 5
A username = "ava_p"
B password = Pink!Cat3
C print(username)

Answer Key

Username and password
Section A: Quick Questions
Q1
A — It identifies who you are
Q2
B — It proves it is really you
Q3
B — Your username
Q4
A — Keep it secret and say no
Q5
A — A password should be kept secret
Section B: Match the Pairs
Q1
username: sam_k7 → Identifies who you are. It is okay to share it, because it only says which account is yours.
Q2
password: ******** → Proves it is really you. It is kept secret, which is why it is hidden with stars when you type it.
Q3
Logging in uses both a username to say who you are and a password to prove it → login(username, password)
Q4
You should never share your password with anyone → share(password) -> NEVER
Q5
Keep my username secret. Tell my friend my password. → This is backwards. The username can be shared, but the password is the secret that must never be shared.
Q6
login(password) // no username → Logging in needs both a username to identify you and a password to prove it. A password alone is not enough.
Section C: Definitions
Q1
username and password — A username identifies who you are and can be shared. A password proves it is really you, so keep it secret and never share it. You use both together when logging in.
Section D: Fill in the Blanks
Q1
username = "sam99"
Q2
password = input("Enter your secret: ")
Q3
login(username, password)
Q4
canShareUsername = True
Q5
if password == savedPassword: print("Logged in")
Section E: Spot the Error
Q1
A — The string is missing its closing quote. It should be username = "sam_k".
Q2
D — The variable name is misspelled. The username variable is called username, so the line should be print("Welcome " + username).
Q3
D — The closing bracket is missing. The line should be print("Logged in") so the login message works.
Q4
C — This line shows the password, which must stay secret. A username can be shared, so it should print username.
Q5
B — The password text is missing its quotation marks. It should be password = "Pink!Cat3".