Question: I am having some trouble with this practice problem. code a function called encrypt , that has one parameter s where s is a string
I am having some trouble with this practice problem.
code a function calledencrypt, that has one parameter s where s is a string and encrypt returns a string which is
the encrypted version of s.
- MAY NOT use any collection (such as a list/array, tuple, or dictionary) but only CAN USE collection of strings.
Program testing:
>>> encrypt("Hello, world")
'dHlerlolwo ,'
>>>> encrypt("1234")
'4132'
>>> encrypt("12345")
'51423'
>>> encrypt("1")
'1'
>>> encrypt("123")
'312'
>>> encrypt("12")
'21'
>>> encrypt("Secret Message")
'eSgeacsrseetM '
>>> encrypt(",'4'r")
"r,''4"
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
