Skip to content

Commit

Permalink
editor projects
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcScott committed Mar 4, 2024
1 parent 7ade8b7 commit afd6582
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
20 changes: 20 additions & 0 deletions en/code/secret-messages-complete/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/python3

alphabet = 'abcdefghijklmnopqrstuvwxyz'
newMessage = ''

message = input('Please enter a message: ')

key = input('Enter a key (1-26): ')
key = int(key)

for character in message:
if character in alphabet:
position = alphabet.find(character)
newPosition = (position + key) % 26
newCharacter = alphabet[newPosition]
newMessage += newCharacter
else:
newMessage += character

print('Your new message is: ', newMessage)
3 changes: 3 additions & 0 deletions en/code/secret-messages-complete/project_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: 'Secret Messages Complete'
identifier: 'secret-messages-complete'
type: 'python'
Empty file.
2 changes: 2 additions & 0 deletions en/code/secret-messages-starter/project_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: 'Secret Messages Starter'
identifier: 'secret-messages-starter'

0 comments on commit afd6582

Please sign in to comment.