Find First And Last Substring Occurrences Using find() rfind() index() rindex() | Python Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2024
  • How to find the first and last occurrences of a character or a substring in a string using the string methods find() rfind() index() and rindex() in Python. Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!

ความคิดเห็น • 5

  • @ivanpalacio4326
    @ivanpalacio4326 ปีที่แล้ว

    I'm guessing the index function would be ideal if used in a try and except to let the user know that the input is invalid. Interesting video!
    Have you thought about doing an argparse video for Python? I've seen videos on the matter, but I think you would make a great video on it. 🙏

    • @PortfolioCourses
      @PortfolioCourses  ปีที่แล้ว

      Yes, that's exactly when it would be useful Ivan! :-)
      And I definitely want to do an argparse video for Python too.

  • @phillippin6699
    @phillippin6699 ปีที่แล้ว

    Straight forward and precise. Thanks

  • @KareemAhmed-nf4jb
    @KareemAhmed-nf4jb 5 หลายเดือนก่อน

    Good