Code Breaking With Python, Day 1
Let's make the dot code using Python. Take your time and have a go at the bonus challenges below the video.
(This is the first of 5 Python posts, they’ll go out every morning at 9am this week. The rest are for paid subscribers but this one is for free. Enjoy! JL)
Ok here we go! What does this say?
We’re going to use Python to make codes like this. Tomorrow we’ll decode them.
Click on this link to open an editor: Start programming!
Click play on the video.
Scroll down for bonus challenges.
Drop me questions at @drjameslambert on Twitter.
Take your time!
Bonus Challenges
Finished the video? Try these:
Try different characters instead of
‘@’
and‘_’
to see if they look better. Or, OR! Find ones that make the code even harder to read. 🤣You can make you’re codes super secure by changing the order of the alphabet. for example
alphabet = “sgh…(rest of the alphabet)” 😀
It would be handy to be able to send numbers like
123…
in code, try adding this to your Python code. 🙂Punctuation marks like
‘.!,’
and spaces‘_____’
. Can you think of a nicer way of handling it? Either remove it completely or include it in the message. 🤨My way of making the encoded lines was ugly:
location_in_alphabet * "_" + "@" + (25 - location_in_alphabet) * "_"
Can you find a nicer way? Hint: make a list of 26 “_” first. 🧐
I used the
lower()
function to remove capital letters from the message before encoding it. Can you modify your code so that it can encode capitals and lower case letters? 🥷
That’s it for today, see you tomorrow!
James
Remember the rest of the Python course is for paying subscribers so…