First pseudocode lines!

Hey guys, I’ve started introduction to IT course on CodeCademy and I wrote my first pseudocode lines. I’m very curious for feedback and ideas.

This was the assignment:

Take two string values called text and pattern.
Search through the value of text …


This content originally appeared on DEV Community and was authored by matthijs pouwels

Hey guys, I’ve started introduction to IT course on CodeCademy and I wrote my first pseudocode lines. I’m very curious for feedback and ideas.

This was the assignment:

  1. Take two string values called text and pattern.
  2. Search through the value of text to check if the value pattern can be found within text.
  3. Notify the user if pattern was found in text or not.

This is my solution:

  1. Input the pattern that needs to be searched
  2. To keep track of whether the text contains the pattern, establish a contains_pattern variable and initially set it to False.
  3. Has the  pattern been found? If not, continue to step 3. If so, skip to step 5.
  4. Is the current word equal to pattern? If not, go back to step 3 and continue to iterate over the entire text. If so, set the contains_pattern variable to True and then continue to step
  5. Is the contains_pattern equal to True? If not, then the pattern is not in the text. If so, then the pattern is in the text!

Would love to hear your thoughts! Any improvements or alternative approaches you'd suggest? 🚀


This content originally appeared on DEV Community and was authored by matthijs pouwels


Print Share Comment Cite Upload Translate Updates
APA

matthijs pouwels | Sciencx (2025-03-11T10:47:51+00:00) First pseudocode lines!. Retrieved from https://www.scien.cx/2025/03/11/first-pseudocode-lines/

MLA
" » First pseudocode lines!." matthijs pouwels | Sciencx - Tuesday March 11, 2025, https://www.scien.cx/2025/03/11/first-pseudocode-lines/
HARVARD
matthijs pouwels | Sciencx Tuesday March 11, 2025 » First pseudocode lines!., viewed ,<https://www.scien.cx/2025/03/11/first-pseudocode-lines/>
VANCOUVER
matthijs pouwels | Sciencx - » First pseudocode lines!. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/03/11/first-pseudocode-lines/
CHICAGO
" » First pseudocode lines!." matthijs pouwels | Sciencx - Accessed . https://www.scien.cx/2025/03/11/first-pseudocode-lines/
IEEE
" » First pseudocode lines!." matthijs pouwels | Sciencx [Online]. Available: https://www.scien.cx/2025/03/11/first-pseudocode-lines/. [Accessed: ]
rf:citation
» First pseudocode lines! | matthijs pouwels | Sciencx | https://www.scien.cx/2025/03/11/first-pseudocode-lines/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.