Sequences: Indexing, Slicing, and Iterating | Python for Beginners Lesson 3 | Code with Kylie

Поділитися
Вставка
  • Опубліковано 6 лют 2025
  • In this beginner lesson, we learn about sequences in Python. Sequences are the foundation of more complex data structures in Python, such as lists and tuples.
    Previously, we introduced the strings as a basic type. In this video, we'll revisit that and introduce it as a compound data type instead. It's a SEQUENCE of characters!
    Using strings as an example, I'll demonstrate the properties of sequences in Python: indexing, slicing, and iterating! These will be applicable to other sequences (lists, tuples, etc) later on.
    Timestamps:
    00:00 Intro and Recap
    00:50 Indexing
    04:14 Slicing
    07:34 Iteration
    11:11 Code Demonstration
    Notes: github.com/kyi...
    Join the discord to learn Python with a community! / discord
    I use replit.com as the code editor. If you have Python and your own editor set up on your computer feel free to use it!
    Feel free to leave any questions.
    Please consider subscribing if you liked this video: www.youtube.co...
    Thanks for watching everyone!
    ~~~~~~~~~~~~~~~~~~~~~~~~
    Follow me on Instagram: / kylieyying
    Follow me on Twitter: / kylieyying
    Check out my website: www.kylieying.com

КОМЕНТАРІ • 20

  • @KylieYYing
    @KylieYYing  2 роки тому +3

    Thanks for watching! :)
    Notes: github.com/kying18/intro-to-programming/blob/main/class-2-types-mutability/notes.md
    Join the discord to learn Python with a community! discord.gg/e8ZHKGU9GC

  • @RR18R
    @RR18R 2 роки тому

    Thank you for the upload, I've just finished watching your begginer course and it is so well explained and fun. Now I am always looking forward to watching your videos.
    You are great!

  • @samialvi4226
    @samialvi4226 Рік тому

    If she teaches Machine learning from the very beginning to advance I'll be learning it to my full even I'm not interested in ML!!!

  • @henrischoonderbeek3456
    @henrischoonderbeek3456 2 роки тому

    Thanks Kylie. Well explained and good to follow along. Looking forward for the next lessons

  • @马正-w5s
    @马正-w5s 2 роки тому

    I learned python before so here is my support for your woek❤❤❤

  • @femidaniel
    @femidaniel 2 роки тому

    Thank you Kylie🙂, 14th in the series now, awesome 👍

  • @Emajjab
    @Emajjab 2 роки тому

    Thank you Kylie your videos are very helpful and simple enough for me to understand as a beginner 👍

  • @arthurnunes4612
    @arthurnunes4612 2 роки тому

    Really good content. I always not really understood the sequences in python, now I understand a lot more, thanks for the lesson.
    (English is not my main language so sorry if a wrote something wrong)

  • @gblakney
    @gblakney Рік тому +1

    could i do this with a list of scores from a test and in the for/in (like for letter in var) statement write a line to take each score fron the list, divide it by the number of questions then multiply by 100 then print the grade? is this in a later video?

    • @gblakney
      @gblakney Рік тому +1

      figured it out! scores = [10, 3, etc] for i in scores (i/number of questions)*100 gives me a percentage grade!

  • @whoismikeyuk
    @whoismikeyuk 2 роки тому

    Very clear explanations. Thank you 🙂

  • @edson_winner
    @edson_winner 2 роки тому

    Great tutorial! Keep them coming!

  • @prashantraj5972
    @prashantraj5972 2 роки тому

    You got another subscriber

  • @dudekulavidyasagar3745
    @dudekulavidyasagar3745 2 роки тому

    Thanks for the leacture

  • @BillieBop_Bites
    @BillieBop_Bites 2 роки тому

    You solve a comparative coding problem like as code code force ?

  • @monty6853
    @monty6853 2 роки тому

    LOVE IT

  • @indian2031
    @indian2031 2 роки тому

    When u typed for letter is letter again a new variable

    • @matazzer
      @matazzer Рік тому

      it is indeed a new variable that refers to whatever iterable value that you specified. unlike some other programming languages, in Python you can use these new variables defined within the loop even outside the loop.
      example:
      *names = ["john", "terry", "maria"]*
      *for name in names:* # for every "name" (can be any word you want, it will be = the item within your list through each iteration, recommended to use a name that makes sense) within the list "names"
      *print(name)* # for every "name" (item) within the list "names" (john, terry, maria), print the item in the list
      --
      *output:*
      john
      terry
      maria
      --
      another example to further clarify:
      *greeting = "hello!"*
      *for x in greeting:* # x = every iterable item (letters/characters) in "greeting"
      print(x)
      --
      *output:*
      h
      e
      l
      l
      o
      !
      --
      and, if i wanted to use the "x" variable outside of the loop, I can:
      *greeting = "hello!"*
      *for x in greeting:*
      print(x)
      *print(x)* # notice lack of indentation means that i am OUTSIDE the for loop now! x is = "!", the final item that it iterated upon
      *print(x)*
      *print(x)*
      --
      *output:*
      h
      e
      l
      l
      o
      !
      !
      !
      !
      --
      hope this helps!

  • @BigRozes.
    @BigRozes. 8 місяців тому

    Only useful videos out here

  • @phisicist7518
    @phisicist7518 2 роки тому

    First.