Question: Python 3 please Exercise 1. Caesar's Ciphers I Write a function encodeCipher(word, num) that takes in a lower case string and a number and creates

 Python 3 please Exercise 1. Caesar's Ciphers I Write a function

Python 3 please

Exercise 1. Caesar's Ciphers I Write a function encodeCipher(word, num) that takes in a lower case string and a number and creates a new lower case string where each character is offset by that number. In other words, the original letters are mapped to the shifted letters. For example, encodeCipher("abc", 2) would map a to c, b to d, c to e and so on, and will therefore return "cde". Note: check what are the functions ord() and chr() used for. Exercise 2. Caesar's Ciphers II Write a function decodeCipher(word, num) that takes a cipher string (of only lower case letters) and a number, and returns the decoded string that is created when every character is replaced by its mapping. For example, decodeCipher("cde", 2) should return "abc". Use this function to decode "jbj fpurzr vf terng" given that the letters had been shifted by 13. Exercise 3. Colored polygons. Write a function cpolygon(n, size) that takes in two arguments: n (the number of sides of a polygon), and size (its side length in pixels). The function draws an n-sided polygon with alternating black and red colors. Hint: The function turtle.color(col) changes the color of the pen to col, which is a string specifying the desired color (black, red, etc.)

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!