String indexing in Python is easy ✂️

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2025

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

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

    # 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 2 ปีที่แล้ว

      Do you include these shortvids to their main courses?

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

    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

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

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

  • @PSIwolf39
    @PSIwolf39 ปีที่แล้ว +5

    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]}.")

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

    you are a true legend.

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

    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??

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

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

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

    very easy to understand ..thanks @Bro Code

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

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

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

    great lesson :D

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

    Great Content!

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

    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

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

      you should have gone far by now i presume

    • @eyalsilbershtein5765
      @eyalsilbershtein5765 หลายเดือนก่อน +1

      @InvestorMkings actually I did, currently in first year of software engineering ;) but thanks

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

      @@eyalsilbershtein5765 nice

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

    First!! pls heart!

  • @preraksemwal
    @preraksemwal 2 ปีที่แล้ว +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❤

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

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

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

      HURRY!

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

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

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

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

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

    thank u bro, i love u

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

    thanks bro

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

    Awesome video Bro, hope you get to 1 mil soon

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

    Thank you

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

    Absolutely chad

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

    great straight forward video. please do one on regex.

  • @אביבביאדגילין
    @אביבביאדגילין 10 หลายเดือนก่อน

    Thanks you so much bro☆

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

    Bro your the true CHAD

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

    Can you try doing some Python exercises, like completing questions by coding in Python

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

      u can make AI do it

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

      @@mamidied4249 yes but then I won't learn

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

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

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

      I went to university

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

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

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

      @@brajagopalmukherjee1588 same with mine

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

    Drop the full SQL course king 👑

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

    What do you use to code

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

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

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

    Yo I'm 2nd Mr. bro

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

    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.

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

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

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

    Sir, can u explain recursion in python?

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

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

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

    Are you Westjett by any chance

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

    How did you learn to code?

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

      I went to university

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

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

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

    i promise end seing later

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

    But isn't this also called slicing?

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

    why dose it say help me

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

    algo

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

    bro just say python is easy

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

    String indexing Dumbest and most boring Python Subject...