Build a Caesar Cipher - Step 4

Tell us what’s happening:

Why doesn’t it work altho the output is the full alphabet??
alphabet = ‘abcdefghijklmnopqrstuvwxyz’
shift = 5
shifted_alphabet = alphabet[:shift] + alphabet[shift:]
print(shifted_alphabet)
output → abcdefghijklmnopqrstuvwxyz

You should assign the concatenation of alphabet[shift:] and the missing first portion of alphabet to the shifted_alphabet variable on the same line it was declared. Use shift to specify where to stop the slicing.

Your code so far


# User Editable Region

alphabet = 'abcdefghijklmnopqrstuvwxyz'
shift = 5
shifted_alphabet = alphabet[:shift] + alphabet[shift:]
print(shifted_alphabet)

# User Editable Region

Your browser information:

User Agent

Challenge Information:

Build a Caesar Cipher - Step 4

shifted_alphabet = alphabet[shift:]

This is the original code you were supposed to concatenate the missing first portion of the alphabet to. You changed that.