Learn String Manipulation by Building a Cipher - Step 14

Tell us what’s happening:

Hi! Although i think find the right answer, i don’t understand why I can not move next step?

Your code so far


# User Editable Region

text = 'Hello World'
shift = 3
alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
empty=''
position_0 = alphabet.find(text[0])
yeni_harf_0 = alphabet[position_0 + shift]
print(yeni_harf_0)
position_1 = alphabet.find(text[1])
yeni_harf_1 = alphabet[position_1 + shift]
print(yeni_harf_1)
position_2 = alphabet.find(text[2])
yeni_harf_2 = alphabet[position_2 + shift]
print(yeni_harf_2)
position_3 = alphabet.find(text[3])
yeni_harf_3 = alphabet[position_3 + shift]
print(yeni_harf_3)
position_4 = alphabet.find(text[4])
yeni_harf_4 = alphabet[position_4 + shift]
print(yeni_harf_4)
position_6 = alphabet.find(text[6])
yeni_harf_6 = alphabet[position_6 + shift]
print(yeni_harf_6)
position_7 = alphabet.find(text[7])
yeni_harf_7 = alphabet[position_7 + shift]
print(yeni_harf_7)
position_8 = alphabet.find(text[8])
yeni_harf_8 = alphabet[position_8 + shift]
print(yeni_harf_8)
position_9 = alphabet.find(text[9])
yeni_harf_9 = alphabet[position_9 + shift]
print(yeni_harf_9)
position_10 = alphabet.find(text[10])
yeni_harf_10= alphabet[position_10 + shift]
print(yeni_harf_10)
yeni_kelime=yeni_harf_0 + yeni_harf_1 + yeni_harf_2 + yeni_harf_3 + yeni_harf_4 + " " + yeni_harf_6 + yeni_harf_7 + yeni_harf_8 + yeni_harf_9 + yeni_harf_10
print(yeni_kelime)

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36

Challenge Information:

Learn String Manipulation by Building a Cipher - Step 14

Hi there and welcome to the forum!
Where did you get this code?

Hi there! Thank you! I wrote the code with the info i had with 13 step. I did not learn the loop function yet. Therefore, i had to write all. It seems i find the right answer but is my way wrong? Because, i cannot move on?

I mean this part of code, it is not supposed to be in this step.
So please reset the step and try following the instructions

Thank you, i also tried to solve it in a shorter way. I reached the solution but again could not pass :confused: Can you at least tell me, are we supposed to learn (as, if or loop functions) on our own and solve it that way? Or should we create the code with the info that we have learned until in this step?

1 Like

Please share your latest code.
Are we talking about Step 14 in Learn String Manipulation by Building a Cipher? There is no need or requirement to use any loops to pass this step.
Yes, the info given at this and previous steps is quite enough to move forward.

Thanks a lot! My mistake was: Instead of just writing only the first step; I solved the whole problem :slight_smile: I think the instruction on this step is kind of confusing. One thinks that he/she should solve the whole problem.

1 Like

I guess you know this already but the first part of the instructions is the context of the whole program that will be written.

The last few sentences are the only instructions for this step:

Modify your existing .find() call passing it text[0] as the argument instead of 'z'.

Each step is structured like this this, with the main thing to implement last. Congrats on writing a whole Caesar cipher yourself though!

2 Likes

Yes, i understood what you said from the hard way :slight_smile: Thank you! I searched how to progress from the internet though :grinning:

1 Like

That’s good! Should always be searching and learning from other resources to supplement your progress on fCC. That habit will serve you well.

2 Likes