Challenge: Caesar Cipher Encoder
Uppgift
Swipe to start coding
Implement a function that encodes a message using a Caesar cipher with a specified shift value. The Caesar cipher shifts each letter in the message by the given amount, wrapping around the alphabet if necessary. Non-letter characters should remain unchanged.
- Shift each uppercase and lowercase letter in
messagebyshiftpositions in the alphabet. - Preserve the case of each letter.
- Do not change any non-letter characters.
- Return the encoded string.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 6
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 4.76
Challenge: Caesar Cipher Encoder
Svep för att visa menyn
Uppgift
Swipe to start coding
Implement a function that encodes a message using a Caesar cipher with a specified shift value. The Caesar cipher shifts each letter in the message by the given amount, wrapping around the alphabet if necessary. Non-letter characters should remain unchanged.
- Shift each uppercase and lowercase letter in
messagebyshiftpositions in the alphabet. - Preserve the case of each letter.
- Do not change any non-letter characters.
- Return the encoded string.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 3. Kapitel 6
single