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

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_2

Step: 3

blur-text-image_3

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

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

1st Edition

1597496251, 978-1597496254

Students also viewed these Databases questions