Master Python: Indexes & Strings - Part 1 (Advanced)

Поделиться
HTML-код
  • Опубликовано: 23 июн 2024
  • Hey guys,
    Today, in this lesson, I'm going to go over a quick comparison between for and while loops. I'm going to go over a quick recap for both and then show you a couple of use cases.
    While loops are great for looping until a certain condition is met. For example, you want to keep executing a certain piece of code until someone types in the correct password. The thing to be aware of while loops is creating an infinite loop! If the condition is never met, then it will keep on executing the code until the program crashes 🤯!
    For loops are great for looping through a collection such as a list, string, etc. For example, if you want to loop through a string to see if the letter "a" exists, a for loop would be great choice for that.
    Tags:
    ==========================
    programming, python, coding, learn how to program, learning python, how to program in python, program using python, python programming, programming tutorials, learn programming, coding tutorials, programming for beginners, how to code, programming languages, coding for beginners, free coding courses, free coding tutorials, free programming courses, free programming tutorials, python basics, python online courses, python coding exercises, python coding tutorials, python programming fundamentals, python crash course, python, indexes, strings, characters, substrings, manipulation, slicing, positions, indexing, searching, extracting, concatenation
  • НаукаНаука

Комментарии •