Define the main function with no arguments assign two values


Problem

• Make a function named encrypt which admits two parameters: a string message that is to be encoded and an integer key. You can assume that the arguments given to the function will be alphabetic strings and will not contain any special characters or numbers. Convert all characters in the string to uppercase Convert each character in the string to its ASCII value and add the key to it Convert the resultant number from adding the key to its string encoding Concatenate all the values to form the encoded string Return the concatenated string

• Define the main function with no arguments Assign two values of a string and an integer that are to be the message and the key respectively. (Do not use input function as it interrupts the autograding scripts) Call the encrypt function with the message and key Print the output. (You can use the values from the sample output to check your implementation) Call the main function.

We will now use a special call for the main function as shown below:

if __name__ == "__main__": main()

Sample Input/Output:
>> encrypt("PyThOn", 3)
>> 839287758281

>> encrypt("Vocareum", 5)
>> 9184727087749082

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Define the main function with no arguments assign two values
Reference No:- TGS03323555

Expected delivery within 24 Hours