Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write two different password creation functions, password1() and password2(), each of which has 3 arguments, intended to be 2 strings s1 and s2, and in

Write two different password creation functions, password1() and password2(), each of which has 3 arguments, intended to be 2 strings s1 and s2, and in the third position a number n.

Function password1 will return a string consisting of the two strings separated by an underscore character. Function password2 will return a string consisting of the (characters of) the number n followed by s1 followed by s2 followed by the (characters of) n.

Hint: To convert a number n to a string use the function str(). So, for example, str(2 + 3) will return '5'

So if your functions work correctly you would have:

In [1]: password1("yellow", "Daisy", 6) Out[1]: yellow_Daisy In [2]: password2("yellow", "Daisy", 6) Out[2]: 6yellowDaisy6 

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 Analytics Systems Engineering Cybersecurity Project Management

Authors: Christopher Greco

1st Edition

168392648X, 978-1683926481

More Books

Students also viewed these Databases questions