Question: 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 returna 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!