Learn String Manipulation by Building a Cipher - Step 41

I’m doing the python projects successfully without help of hints or the forum yet I don’t seem to be learning . I have currently already repeated the python regime twice but the code continues to seem alien as I advance.

How can I understand the code better?

Hello,
before I can provide any suggestions, can you please explain more what you meant by the code continues to seem alien as I advance also do you have any previous programming experience?

If you’ve finished the Python material twice and now you’re able to get through it “successfully without help of hints or the forum” then it sounds like you have learned it.

If you don’t want to repeat it you can try doing your own project. Think of a problem that you want to solve for yourself using Python. That will help solidify what you’ve learned and practice.

Keep in mind you will never memorize everything. It’s normal to constantly look up code syntax and have no idea where to start.

I haven’t completed the material, I just repeated it said number of times and I still get perplexed.

what do you recommend?

Hello,
No I don’t have previous programming experience. To elaborate my previous statement. Simply put, as I advance I am left perplexed and puzzled. The code doesn’t make any sense to me. What I’m currently doing is like speaking a foreign language through imitation and sheer trial and error. What is your advice?

Find something practical, for example a small repetitive task at work, a calculation to decide something. Think how you would automate it, think input, action steps, output. You will see:

  • sequence, one action after another,
  • loops, a group of steps you repeat a multiple of times
  • decisions, a point where you must decide something based on a result which could end our process or execute a separate set of steps

Now see what Python commands you need to code your solution. Code it, debug it until you get the required result. Then build something bigger.

You can learn the words but if you don’t go out and speak it you will never understand the practical everyday use.

1 Like

I see. Make up your own project, you need something less guided.

Do you understand what a loop is and what a variable is? And how to use them?

I have noticed you have an Arabic name, which mean you are arab such as me, I wanted to suggest a website that I personally follow to learn programming,
Homepage | ProgrammingAdvices
Programming Advices - YouTube
Feeling perplexed and puzzled while learning to code is completely normal, especially in the beginning, however that can also mean you have a problem in the fundamentals like loops, variables, if-else, functions and basic problem solving, I suggest you follow the roadmap in the web site I provided to improve and become better

But I’m underaged and the problems around me are too complex for me to solve with only experience in a python string manipulation course. Any more advice?

I tried to work on my own ceaser cipher but I forgot all the steps and I fear going back to the course will not help me in any long term way. I’ve tried google but dont know what to search. For example:
Screenshot 2024-08-25 205001
I cant seem to understand the function of :
result += chr((ord(char) + shift - 65) % 26 + 65)
and the ai isnt elaborating it well enough. What would you recommend? What would you do if you were stuck trying to build a project due to a lack of knowledge and understanding of the code? How would you approach building a CEASER CIPHER?

But I’m not Arab. Its just an arab name, but I think it might be a result of poor understanding of the fundamentals. But again, I have abruptly repeated the course twice now.

Sorry for the misunderstanding
You said it yourself; it is a result of poor understanding of the fundamentals and basic problem-solving techniques, I suggest you look for an online course such as this one, an introduction to CS fundamentals using python
MIT 6.100L Introduction to CS and Programming using Python, Fall 2022 - YouTube

1 Like

Do you understand how a Caesar cipher works that you can do it on paper without programming?

Do not think of it in terms of “remembering all the steps”.

Just know how the cipher works, you can look it up if you want, then implement each step in code. You can even look that up, it doesn’t matter. Search “python how to input a string” or “how to shift a string” or “how to add numbers python”.

Importantly though FIRST you just need to understand the cipher enough that you could do it on paper.

image
Also, in this code I cant seem to understand why the ai wrote it. The freecodecamp course approached the caesar cipher in a different method at this particular step. How would you approach trying to understand it? And if you were to to go through a course, what is the most effective thing you can do, while actively doing the course, that can help you retain more knowledge.

Oh, you have only completed the string manipulation section, and not all the sections.

I would say find some information on the basics of programming. I think this course assumes you have a basic understanding of programming. Once you understand the foundations of programming then come back to the course. This course shows you how to apply the basics in Python.

Also read up about ASCII. 65 = A and by adding 13 to 65 you get N. In that way you create your encoded message. To decode you add 13 to the letters of the encoded message because there are 26 letters in the alphabet and after 90 you go back to 65.