# Video of looping through strings

**URL:** <https://forum.freecodecamp.org/t/video-of-looping-through-strings/465198>\
**Category:** Curriculum Help\
**Tags:** python\
**Created:** [June 16, 2021, 11:42am UTC](https://forum.freecodecamp.org/t/video-of-looping-through-strings/465198 "2021-06-16T11:42:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tirth4uall](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/tirth4uall/32/220085_2.png) [@tirth4uall](https://forum.freecodecamp.org/u/tirth4uall)\
**Post date:** [June 16, 2021, 11:42am UTC](https://forum.freecodecamp.org/t/video-of-looping-through-strings/465198/1 "2021-06-16T11:42:46Z")

</div>

in the following code:

```auto
     fruit='banana'
     for letter in fruit:
           print(letter)

```

How does computer know that the word ‘letter’ is the letter that we know? because we haven’t defined anything then How can python print the letters of banana?

---

<div class="post-metadata">

**Author:** ![veljkocukic](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/veljkocukic/32/145358_2.png) [@veljkocukic](https://forum.freecodecamp.org/u/veljkocukic)\
**Post date:** [June 16, 2021, 12:09pm UTC](https://forum.freecodecamp.org/t/video-of-looping-through-strings/465198/2 "2021-06-16T12:09:47Z")

</div>

It doesn’t, you can put whatever you wanted instead of “letter”, you could have put just a single letter and it would work. In this loop, the computer is assigning a variable called “letter” for each letter in your word and reading it. Name doesn’t matter as long as you have put some kind of value 🙂

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [June 16, 2021, 1:25pm UTC](https://forum.freecodecamp.org/t/video-of-looping-through-strings/465198/3 "2021-06-16T13:25:06Z")

</div>

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (`</>`) to add backticks around text.

 ![Pre-formatted-text](https://global.discourse-cdn.com/freecodecamp/original/3X/1/b/1b18854f1059217f29370444396145cc3a0cd8ae.gif)

See [this post](https://forum.freecodecamp.org/t/forum-code-formatting/25574) to find the backtick on your keyboard.  
**Note:** Backticks (`) are not single quotes (’).

---

<div class="post-metadata">

**Author:** ![tirth4uall](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/tirth4uall/32/220085_2.png) [@tirth4uall](https://forum.freecodecamp.org/u/tirth4uall)\
**Post date:** [June 16, 2021, 1:39pm UTC](https://forum.freecodecamp.org/t/video-of-looping-through-strings/465198/4 "2021-06-16T13:39:44Z")

</div>

Ohk…got it.  
Thank you so much  
@veljkocukic

---

<div class="post-metadata">

**Author:** ![Sylvant](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/sylvant/32/254977_2.png) [@Sylvant](https://forum.freecodecamp.org/u/Sylvant)\
**Post date:** [June 16, 2021, 6:49pm UTC](https://forum.freecodecamp.org/t/video-of-looping-through-strings/465198/5 "2021-06-16T18:49:36Z")

</div>

I strongly advise you follow the FCC curriculum on Scientific Computing with Python, which is represented by the free course Python for Everybody by Dr. Charles Severance and one of the things he puts as sideline emphasis is naming conventions, or the lack of such, when it comes to computers

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [December 16, 2021, 6:50am UTC](https://forum.freecodecamp.org/t/video-of-looping-through-strings/465198/6 "2021-12-16T06:50:37Z")

</div>

Closed on December 16, 2021, 6:50am UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
