Instructions Write a function create_password(pet_name, fav_number) that will return a password with the following pattern: : fav_number followed by the pet_name followed by the underscore and fav_number (see example below). Create a program that reads pet name and favorite number from the user, uses the function above, and uses the return value to output: Your new password is "3Angel_3".
Instructions Write a function create_password(pet_name, fav_number) that will return a password with the following pattern: : fav_number followed by the pet_name followed by the underscore and fav_number (see example below). Create a program that reads pet name and favorite number from the user, uses the function above, and uses the return value to output: Your new password is "3Angel_3".
Chapter3: Data Representation
Section: Chapter Questions
Problem 3RP
Related questions
Question
Passwords, again
Learning objectives
In this lab, you will practice:
- writing a function to match the specifications
- using string concatenation to generate a new return value
- writing your code a module
Instructions
-
Write a function create_password(pet_name, fav_number) that will return a password with the following pattern: : fav_number followed by the pet_name followed by the underscore and fav_number (see example below).
-
Create a program that reads pet name and favorite number from the user, uses the function above, and uses the return value to output: Your new password is "3Angel_3".
Example
Input:
Angel 3Output:
Your new password is "3Angel_3".Note: Your program must define and call the following function: def create_password(pet_name, fav_number)
# Define your function here.
if __name__ == '__main__':
# Type your code here.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning