Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python 5.17 LAB: Stronger Passwords CSW8 Learning Goals In this lab, you will practice: - writing a function to match the specifications - using string

python
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
5.17 LAB: Stronger Passwords CSW8 Learning Goals In this lab, you will practice: - writing a function to match the specifications - using string concatenation or fstrings to generate a new string value - writing the main program to call your function Instructions 1. Write a function create_password () expects two parameters pet_name (a string) and fav number (an integer). The function returns a new password generated using the foilowing pattern. (f fav_number followed by the pet_name followed by the star * and fav_number again (see the example below) 2. Create a program that gets a pet name and a favorite number as input from the user, calis the above function, and then prints the out as shown below. Example - Remember that you cannot directly concatenate an integer and a string - you need to convert an integer into a string using either st r () or by using f-strings. Troubleshooting - If you are getting AssertionError make sure that your create_password () function is returning the correct value: - If you are failing the Unit Tests but passing all of the 'Compare Output' tests make sure that your create_password() function is returning the correct value. This error is likely due to the if __ name _ = _ main _ ': block print ing the right value, but the function create_password () is not creating/returning the correct value. Program errors displayed here Eile "main.py", line 8 print (f'your new password 18 " (creace_password (pot_name, fav_number)", ') SyntaxError: invalid ayntax Coding trai of your work

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

Discuss the importance of primary keys to the accounting database.

Answered: 1 week ago

Question

b. Where did they come from?

Answered: 1 week ago

Question

c. What were the reasons for their move? Did they come voluntarily?

Answered: 1 week ago

Question

5. How do economic situations affect intergroup relations?

Answered: 1 week ago