String indexing in Python is easy ✂️

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ค. 2024
  • #python #tutorial #course
    00:00:00 string indexing
    00:05:17 last 4 digits exercise
    00:06:27 reverse a string exercise
    00:07:06 conclusion
    indexing = accessing elements of a sequence using [] (indexing operator)
    [start : end : step]
    credit_number = "1234-5678-9012-3456"
    print(credit_number[0])
    print(credit_number[0:4])
    print(credit_number[:4])
    print(credit_number[4:8])
    print(credit_number[4:])
    print(credit_number[-1])
    print(credit_number[-4:])
    print(credit_number[::2])
    print(credit_number[::3])
    EXERCISE 1
    credit_number = "1234-5678-9012-3456"
    last_digits = credit_number[-4:]
    print(f"XXXX-XXXX-XXXX-{last_digits}")
    EXERCISE 2
    credit_number = "1234-5678-9012-3456"
    credit_number = credit_number[::-1]
    print(credit_number)

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

  • @BroCodez
    @BroCodez  ปีที่แล้ว +26

    # indexing = accessing elements of a sequence using [] (indexing operator)
    # [start : end : step]
    credit_number = "1234-5678-9012-3456"
    print(credit_number[0])
    print(credit_number[0:4])
    print(credit_number[:4])
    print(credit_number[4:8])
    print(credit_number[4:])
    print(credit_number[-1])
    print(credit_number[-4:])
    print(credit_number[::2])
    print(credit_number[::3])
    # EXERCISE 1
    credit_number = "1234-5678-9012-3456"
    # last_digits = credit_number[-4:]
    # print(f"XXXX-XXXX-XXXX-{last_digits}")
    # EXERCISE 2
    credit_number = "1234-5678-9012-3456"
    credit_number = credit_number[::-1]
    print(credit_number)

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

      Do you include these shortvids to their main courses?

  • @KDX05
    @KDX05 ปีที่แล้ว +16

    Wanted to thank you Bro code,thanks to your lessons I learned Java and now I'm way ahead of my course in school and that made my life so easier,also im looking forward to learning other programming languages with your teaching

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

    Well, that's quick! Keep up the good works!

  • @o2k0be
    @o2k0be ปีที่แล้ว +6

    Less time , Very quality teaching. Your name defines you Bro Code!!

  • @piptxt7185
    @piptxt7185 ปีที่แล้ว +16

    Is that thumbnail your way of saying that you are locked in a basement forced to make coding tutorials?

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

    Great Content!

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

    great lesson :D

  • @eyalsilbershtein5765
    @eyalsilbershtein5765 ปีที่แล้ว +8

    I love your videos so much! You have helped me a lot! I am currently struggling with importing and using other python files to the main python file... Could you please do a video about writing and reading from other python files?
    Thanks

  • @iskier429
    @iskier429 ปีที่แล้ว +2

    you are a true legend.

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

    bro this video came out just i was doing string indexing with array for my game
    THNX

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

    Awesome video Bro, hope you get to 1 mil soon

  • @user-gp3vd3uw4q
    @user-gp3vd3uw4q 4 หลายเดือนก่อน

    Thanks you so much bro☆

  • @sohambachhav4923
    @sohambachhav4923 ปีที่แล้ว +4

    Bro your Python Vids were just a gold mine for me and many of my friends. Less time quality teaching thanks for it bro
    one request :- Can you start JS or React Js course and also some python projects??

  • @preraksemwal
    @preraksemwal ปีที่แล้ว +2

    Hey @BroCode,
    Love your channel.
    I really liked your previous logo for the channel, and also the introductory + concluding short funny monologues, like in javaFX videos.
    Please bring that vibe back❤

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

    Late to this party. Currently heading through Intro to Scripting. Found your channel and love it. Thank you! Sub’d.

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

    WOW! can't imagine how good are u at python!

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

    thanks bro

  • @joncaldwell4753
    @joncaldwell4753 หลายเดือนก่อน

    Thank you

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

    thank u bro, i love u

  • @deborahchirambo143
    @deborahchirambo143 9 หลายเดือนก่อน

    very easy to understand ..thanks @Bro Code

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

    great straight forward video. please do one on regex.

  • @Ravi.Kumar-
    @Ravi.Kumar- ปีที่แล้ว

    Is there any full course of python that you have prepared. I would like to learn from you. I’m new to programming and struggling to get the logic.

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

    Absolutely chad

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

    yo bro can u make a lua tutorial pls? also nice video

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

    Hello bro
    Can you make a video on argument counts and argument vectors in C programming language

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

    Sir, can u explain recursion in python?

  • @talknotheduck595
    @talknotheduck595 ปีที่แล้ว +1

    What do you use to code

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

    Hey , Ik this is unrelated but can u pls make a course on react js? Thanks gigaChad😅

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

    Can you make a renewed" How to make Snake Game"

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

    Bro your the true CHAD

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

    Drop the full SQL course king 👑

  • @brajagopalmukherjee1588
    @brajagopalmukherjee1588 ปีที่แล้ว +1

    Sir how did you learn all these technologies? What are learning strategies couldnu share ? You are an inspiration ,love from India♥️

    • @BroCodez
      @BroCodez  ปีที่แล้ว +3

      I went to university

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

      @@BroCodez great University,in our university they never go depth

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

    Please Bro can u explain for me why u write (f) like string
    (f "xxxx xxxx xxxx {last_digits}")./
    Thank u

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

    Are you Westjett by any chance

  • @resoiseatingcorn
    @resoiseatingcorn ปีที่แล้ว +2

    First!! pls heart!

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

    Yo I'm 2nd Mr. bro

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

    How did you learn to code?

    • @BroCodez
      @BroCodez  ปีที่แล้ว +4

      I went to university

  • @PSIwolf39
    @PSIwolf39 6 หลายเดือนก่อน

    Here's some code I wrote with string indexing:
    import math
    firstName = input(f"What is your first name?: ")
    print(f"The first letter of your first name is {firstName.upper()[0]}.")
    print(f"The last letter of your first name is {firstName.upper()[-1]}.")
    print(f"Your first name written backwards is {firstName[::-1]}.")
    middleName = input(f"What is your middle name?: ")
    print(f"The first letter of your middle name is {middleName.upper()[0]}.")
    print(f"The last letter of your middle name is {middleName.upper()[-1]}.")
    print(f"Your middle name written backwards is {middleName[::-1]}.")
    lastName = input(f"What is your last name?: ")
    print(f"The first letter of your last name is {middleName.upper()[0]}.")
    print(f"The last letter of your last name is {middleName.upper()[-1]}.")
    print(f"Your last name written backwards is {middleName[::-1]}.")
    print(f"Your initials are {firstName[0]}{middleName[0]}{lastName[0]}.")

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

    i promise end seing later

  • @sainishantbiradar8022
    @sainishantbiradar8022 4 หลายเดือนก่อน

    algo

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

    why dose it say help me

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

    But isn't this also called slicing?

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

    bro just say python is easy

  • @noliyeb
    @noliyeb 11 หลายเดือนก่อน

    String indexing Dumbest and most boring Python Subject...