JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Gallery
Solution Update Variables
Share
Explore
Gallery
Solution Update Variables
Solution Update Variables
Solution
The Task
Python Starter Code
Code Clips
Python Starter Code
Copy and paste the code below into your
main.py
file before you begin the task.
# assign (store) a value
passCode
=
123456
# assign (store) a value
password
=
'ZYXW0987'
print
(
'\n'
)
# display blank line
# display the value stored in the variable
print
(
'The temporary passcode is '
+
str
(
passCode
)
)
# enter and store a new value in the variable (assign)
passCode
=
int
(
input
(
'Please enter a new pass code: '
)
)
# display the value stored in the variable
print
(
'Your new passcode is '
+
str
(
passCode
)
)
print
(
'\n'
)
# display blank line
# display the updated value stored in the variable
print
(
'Your temporary password is '
+
password
)
# enter and store a new value in the variable (assign)
input
(
'Enter a new secure password: '
)
# Display the new value stored for the pasword
print
(
'\n'
)
# display blank line
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.