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".

Systems Architecture
7th Edition
ISBN:9781305080195
Author:Stephen D. Burd
Publisher:Stephen D. Burd
Chapter3: Data Representation
Section: Chapter Questions
Problem 3RP
icon
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

  1. 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).

  2. 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 3

Output:

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.

main.py
Load default template...
1 # Define your function here.
2
3 if
# Type your code here.
name
main ':
4
Transcribed Image Text:main.py Load default template... 1 # Define your function here. 2 3 if # Type your code here. name main ': 4
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Datatypes
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning