preview

Functions For Running An Encryption Or Decryption

Decent Essays

# Functions for running an encryption or decryption.

# The values of the two jokers.
JOKER1 = 27
JOKER2 = 28

# Write your functions here:

def clean_message(whatever_message): ' ' ' (str) -> str Convert your message into upper case and does only include alphabetical characters, that also means that spaces are not allowed. >>> clean_message("i am number four") 'IAMNUMBERFOUR ' >>> clean_message("compu23456!!!! science") 'COMPUSCIENCE ' ' ' ' # set message to an empty message, that 's for the message that # be interpreted by python based on the message you gave. message = "" # we only want to interpret all values that are alphabetical characters for each_letter in …show more content…

# that is, add 1 then change their positions deckofcards[a], deckofcards[a + 1] = deckofcards[a + 1], deckofcards[a]

def move_joker_1(deckofcards): ' ' ' (list of int) -> Nonetype Look for JOKER1 and move this with the card next to it (That is the card under it). If card27 or the joker is at the bottom of the deck of cards, switch this card and put it on top. Req: If Joker 1 (card27) is to be moved at the bottom one time only. >>> deckofcards = [1,4,7,10,13,16,19,22,25,28,3,6,9,12,15,18,21,24,27, 2,5,8,11,14,17,20,23,26] >>> move_joker_1(deckofcards) >>> deckofcards [1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 3, 6, 9, 12, 15, 18, 21, 24, 2, 27, 5, 8, 11, 14, 17, 20, 23, 26] >>> deckofcards = [22, 25, 2, 3, 6, 9, 12, 27] >>> move_joker_1(deckofcards) >>> deckofcards [27, 25, 2, 3, 6, 9, 12, 22] ' ' '

# find where joker1 is in the

Get Access