JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Debug 5.2. Worst Password
Share
Explore
Gallery
Solution Debug 5.2. Worst Password
Solution Debug 5.2. Worst Password
Solution
The Task
Python Starter Code
Code Clips
Solution
Solution
solution
# display blank line
print
(
'\n'
)
#ask the user to choose an option
print
(
'What is the most common password ?'
)
print
(
'enter 1 for : password'
)
print
(
'enter 2 for : 123456'
)
print
(
'enter 3 for : qwerty'
)
print
(
'enter 4 for : 12345'
)
# display blank line
print
(
'\n'
)
choice
=
int
(
input
(
'Please enter the number for answer: '
)
)
# display blank line
print
(
'\n'
)
# check the choice
# if it is 2, display message for correct answer
# otherwise display an message for incorrect answer.
if
(
choice
==
2
)
:
print
(
"Yes! Can you believe that?"
)
else
:
print
(
'It is pretty poor, but not the worst!'
)
# display blank line
print
(
'\n'
)
original
# display blank line
print
(
'\n'
)
#ask the user to choose an option
print
(
'What is the most common password ?'
)
print
(
'enter 1 for : password'
)
print
(
'enter 2 for : 123456'
)
print
(
'enter 3 for : qwerty'
)
print
(
'enter 4 for : 12345'
)
# display blank line
print
(
'\n'
)
choice
=
int
(
input
(
'Please enter the number for answer: '
)
)
# display blank line
print
(
'\n'
)
# check the choice
# if it is 2, display message for correct answer
# otherwise display an message for incorrect answer.
if
(
choice
==
2
)
:
print
(
"Yes! Can you believe that?"
)
print
(
'It is pretty poor, but not the worst!'
)
# display blank line
print
(
'\n'
)
Gallery
Share
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.