Type casting in Python is easy 💱

Sdílet
Vložit
  • čas přidán 3. 08. 2024
  • type casting = The process of converting a value of one data type to another
    (string, integer, float, boolean)
    Explicit vs Implicit
    name = "Bro"
    age = 21
    gpa = 1.9
    student = True
    print(type(name))
    print(type(age))
    print(type(gpa))
    print(type(student))
    age = float(age)
    print(age)
    gpa = int(gpa)
    print(gpa)
    student = str(student)
    print(student)
    name = bool(name)
    print(name)
    00:00:00 what is type casting?
    00:01:24 type function
    00:02:23 explicit cast
    00:06:17 implicit cast
    #type #cast #casting

Komentáře • 114

  • @BroCodez
    @BroCodez  Před rokem +40

    # type casting = The process of converting a value of one data type to another
    # (string, integer, float, boolean)
    # Explicit vs Implicit
    name = "Bro"
    age = 21
    gpa = 1.9
    student = True
    # print(type(name))
    # print(type(age))
    # print(type(gpa))
    # print(type(student))
    age = float(age)
    print(age)
    gpa = int(gpa)
    print(gpa)
    student = str(student)
    print(student)
    name = bool(name)
    print(name)

    • @hallilo7166
      @hallilo7166 Před rokem +3

      Hi brocode I love your videos you helped me so much starting with java and we can watch that all for free THX 😊

    • @Cp_elisha
      @Cp_elisha Před 8 měsíci +2

      bro what is name of tool you are using it's vscode or what

    • @balaportejean7015
      @balaportejean7015 Před 3 měsíci

      @@Cp_elishapycharm
      And he downloaded python online
      Watch the first video of the series

  • @joysticksforjesuschrist
    @joysticksforjesuschrist Před 6 měsíci +7

    I love how bro almost put his GPA as 4.0 and then backspaced 😂

  • @brittany8367
    @brittany8367 Před 6 měsíci

    Thank you for breaking everything down into such an easily understandable explanation!

  • @Afghanistanfutsalfans
    @Afghanistanfutsalfans Před rokem +3

    Outstanding Explanation I have ever watched!

  • @abdulhannan-18
    @abdulhannan-18 Před 8 měsíci +7

    imp Only strings can concatenate.
    student = True
    print(student)
    print(type(student))
    student = str(student)
    print(student)
    print(type(student))
    print("Hello" + student)
    True
    True
    HelloTrue

  • @punchline1729
    @punchline1729 Před 9 měsíci +1

    Just found this amazing Python playlist, thanks for your help

  • @sunny34504
    @sunny34504 Před 10 měsíci

    I can't believe that I found an easy way to learn python! I'm so grateful thankss a lott!!

  • @user-ly5we6xl4v
    @user-ly5we6xl4v Před 8 měsíci +1

    NICELY DONE...❤

  • @RAHAT_PY
    @RAHAT_PY Před rokem +1

    bro it's awsome
    i admit here new
    INSAALLAH soon i will finised the playlist💖

  • @joanneosborne2428
    @joanneosborne2428 Před 6 měsíci +5

    I appreciate your training approach; it's clear, enjoyable, and straightforward. Thank you for keeping it simple and to the point.

  • @user-ace96plays
    @user-ace96plays Před 8 měsíci +2

    NICELY DONE BRO...❤

  • @HsuMonMonThant
    @HsuMonMonThant Před rokem

    Thank you for this wonderful video.

  • @user-ee2fu8gh7e
    @user-ee2fu8gh7e Před 5 měsíci

    very logical and useful, making the complex theory understandable!!

  • @earth7641
    @earth7641 Před rokem +3

    I glad to see your channel grow and learning program from your channel, being game programmer is always my dream.

  • @mohamad_subhi
    @mohamad_subhi Před 5 měsíci

    Perfect. absolutely perfect🤯🤩🤩

  • @munakusik
    @munakusik Před rokem +4

    Have watched u since first long collection of videos
    Nice to see that u still help to other people
    Btw wanna see more guides by you
    thanks

  • @tongtruonghai331
    @tongtruonghai331 Před rokem +2

    3rd hello!!, all ur vids are good that's i got a improve in programming.

  • @MohyDev
    @MohyDev Před rokem +23

    I have always believed that education is the ultimate code to crack. Thanks to Bro Code, I have been able to unlock some of the most complex programming languages and computer science concepts with ease. Your videos have been instrumental in helping me level up my skills. So, from the bottom of my heart (and stack), thank you for being the best educational channel out there. Keep up the good work, Bro Code! Your dedication to educating the masses about programming languages and computer science has been truly inspiring. I would love to connect with you and learn more about your journey and how you became one of the best educational channels out there. again, thank you for being a constant source of knowledge and inspiration for us all. You're the real MVP, Most Valuable Programmer

  • @soyozzz
    @soyozzz Před rokem +6

    Wow, i'm the first one here. Hello and thank you for the video!

  • @boundlesspresents190
    @boundlesspresents190 Před rokem

    Great explanation

  • @krissavagelive
    @krissavagelive Před 5 měsíci

    Great explanation. Thanks Bro!

  • @getone135th
    @getone135th Před 7 měsíci

    thank you for your time and efforts and teaching me this.

  • @alanjaf9879
    @alanjaf9879 Před rokem

    This was usefull, thank you

  • @unknowndrharry
    @unknowndrharry Před rokem

    Your crazy man, so easy to understand, even tough I am from arts background.

  • @shaikakhil4h136
    @shaikakhil4h136 Před rokem

    Recently I seen ur channel bro
    I like the way ur teaching bro
    Tq bro keep doing like this for us bro💕

  • @abdulhannan-18
    @abdulhannan-18 Před 8 měsíci +1

    Basically bool is to check whether that INPUT IS GIVEN OR NOT.
    userinput = input("Your name: ")
    userinput = bool(userinput)
    print(userinput)
    if user give any input then True if user does not give any input then False.
    #code1
    name = "Bro"
    name = bool(name)
    print(name)
    True
    #code2
    name = "" #empty string. As there is nothing that's why it will be false.
    name = bool(name)
    print(name)
    False

  • @Markos1979
    @Markos1979 Před 10 měsíci

    you are the best.

  • @wmstram1
    @wmstram1 Před rokem

    Watched it. Liked it.

  • @mdjhangirislam5237
    @mdjhangirislam5237 Před 9 měsíci

    this chanel is very helpful for me! thanks bro code

  • @krzysztofbartoszek2386

    Finally thank you very much

  • @cozycubix
    @cozycubix Před rokem

    good job , thanks

  • @BurhanTosuner
    @BurhanTosuner Před rokem

    helpfull and thankyou

  • @user-fc8vj5dy9g
    @user-fc8vj5dy9g Před 8 měsíci

    very helpful bro!

  • @Faulty21
    @Faulty21 Před rokem +1

    Very helpful I appreciate the teaching 🫵🏾💯

  • @kingmorbcr1172
    @kingmorbcr1172 Před rokem +5

    i love this channel

  • @XNightmaresX09
    @XNightmaresX09 Před rokem +4

    Bro code : Uploaded a video
    his fans be like : Finally we can find inner peace

  • @haltsmaul.
    @haltsmaul. Před rokem +16

    Probably important to note that in other programming languages such as Java, you can't just change the data type of a variable.
    int num = 3;
    num = (float) num;
    This would throw an exception because you can't assign a float to an integer variable.

    • @BroCodez
      @BroCodez  Před rokem +11

      that's a good point

    • @MrAerobitch
      @MrAerobitch Před rokem

      @haltsmaul I come from Java as well, there is a way to do that in python?

  • @kangyuan9084
    @kangyuan9084 Před 6 měsíci

    Grateful

  • @bekturasanbekov1979
    @bekturasanbekov1979 Před rokem

    thx 4 vid bro !

  • @jhassee
    @jhassee Před rokem +1

    Appreciate you "Bro"

  • @marlor3200
    @marlor3200 Před 5 měsíci

    appreciate your bro

  • @st0kersenpai
    @st0kersenpai Před 8 měsíci +2

    in my pycharm version when i convert a float to string it just round offs the number like 4.9 becomes 5 and while converting boolean to an integer true becomes 1 and false becomes 0

  • @tourakaianimation7766
    @tourakaianimation7766 Před rokem +8

    I am watching your videos during the lectures because the professor is boring. The efforts you put into each video is incredible.
    Can you also make tutorials about MIPS assembly language?

    • @BroCodez
      @BroCodez  Před rokem +9

      I'll take a look at MIPS but I do have a lot of other work to do too :(

    • @theye29
      @theye29 Před rokem +2

      @@BroCodez just a question, do you work as a programmer? if yes, how much do you make? i am thinking in become a senior programmer but im unsure

  • @joncaldwell4753
    @joncaldwell4753 Před 2 měsíci

    Thank you

  • @Janush___
    @Janush___ Před 2 měsíci

    thanks bro

  • @HsoliDer
    @HsoliDer Před rokem

    thank you bro

  • @erdemdemir2852
    @erdemdemir2852 Před 2 měsíci

    random comment because this tutorial is great

  • @Istikomah-qr1ij
    @Istikomah-qr1ij Před rokem

    thank you Bro

  • @kalyanm6426
    @kalyanm6426 Před rokem

    Nice😂😂

  • @Abzarad
    @Abzarad Před 2 měsíci

    thanks Bro

  • @XNightmaresX09
    @XNightmaresX09 Před rokem +1

    Please see my comment and hope you liked it because TBH I am your big fan and you reached programming to me and am still watching your playlist of python cuz I wanna learn it!

  • @zahraalemi1872
    @zahraalemi1872 Před 6 měsíci

    usefull

  • @tixer9786
    @tixer9786 Před rokem

    Thanks

  • @fozero0
    @fozero0 Před rokem

    thx bro :D

  • @user-bj3qq7hc9f
    @user-bj3qq7hc9f Před 10 měsíci

    wow

  • @vxmp-cl5kc
    @vxmp-cl5kc Před měsícem

    i love you bro ur the god

  • @Curious_Clover
    @Curious_Clover Před 3 měsíci

    Interesting. I need to know how to do this in Java.

  • @officiallypaula510
    @officiallypaula510 Před rokem

    thanks

  • @kalyanm6426
    @kalyanm6426 Před rokem

  • @CritEnjoyer
    @CritEnjoyer Před 4 dny

    thank

  • @YGhustler1
    @YGhustler1 Před 20 dny

    yeyeyey

  • @tennybabcock5146
    @tennybabcock5146 Před 2 měsíci

    thank you bro code

  • @sagal5109
    @sagal5109 Před rokem +1

    What program do you use to code? (Btw, I'm beginner :))

    • @howtocraft2415
      @howtocraft2415 Před rokem +1

      I know I am late but in this video he is teaching python

  • @user-ft1mw9bg4m
    @user-ft1mw9bg4m Před rokem +1

    how does every one else do a course like this. do you use the same file for every single episode or do you save a separate one for each or do something else?

    • @passportbro904
      @passportbro904 Před rokem +1

      You must be far in there now, I hope you used seperate files or you may of been confused lol, I'm learning also and love it

  • @shantanupundir9965
    @shantanupundir9965 Před měsícem

    Done

  • @chinmaydwivedi0712
    @chinmaydwivedi0712 Před měsícem

    Random Comment
    already subscribed so i am an Authentic Fellow Bro
    OK??

  • @makoblox
    @makoblox Před rokem

    yes more python

  • @abdulhannan-18
    @abdulhannan-18 Před 8 měsíci

    When typecasting an integer to bool, it is always True for any positive or negative number except for.
    For zero, it is false.
    #code
    age = 19
    age = bool(age)
    print(age)
    True
    #code
    age = 0
    age = bool(age)
    print(age)
    False

  • @abdulhannan-18
    @abdulhannan-18 Před 8 měsíci

    gpa = 1.9
    gpa1 = int(gpa)
    gpa2 = (gpa%1)
    gpa3 = gpa1 + gpa2
    print(gpa3)
    1.9

  • @manamnice
    @manamnice Před rokem

    Any git and Linux tutorial?

  • @NguyenHoang-yo5gg
    @NguyenHoang-yo5gg Před rokem

    can you do one more Winform course I'm having a problem with it, Bro Code please help me :((

  • @radinahmadi2211
    @radinahmadi2211 Před 4 měsíci

    I love you

  • @Poifix
    @Poifix Před rokem

    So is type casting in Py the same as type conversion in JS?

  • @muhammadkarangwa
    @muhammadkarangwa Před měsícem

    I’m on the train of bros

  • @realGrantT
    @realGrantT Před měsícem

    this dude sounds like chris McLean

  • @Itzyaboyjammy
    @Itzyaboyjammy Před 7 měsíci

    can i use vs code instead

  • @APTsec
    @APTsec Před měsícem

    Hey Girl... I don't care if you are not my type. We can always typecast

  • @illubillu69
    @illubillu69 Před 5 měsíci

    my gpa would be a solid ahh 4.0 no no no 1.9

  • @im_not_molhem
    @im_not_molhem Před 8 měsíci +1

    name = “Bro Code”
    age = 22
    rating = 100.0
    useful = True

  • @Ranxx7
    @Ranxx7 Před rokem

    Oh

  • @Dex-uq8ff
    @Dex-uq8ff Před 2 měsíci

    Free algorithm

  • @AyaanZaheerMusic
    @AyaanZaheerMusic Před 5 měsíci

    do you have c or c++ course

  • @user-ace96plays
    @user-ace96plays Před 2 měsíci +1

    3/106

  • @UIEC_MANESH_RAM-tb1hb

    can i please know which country ur from ??

  • @abdulhannan-18
    @abdulhannan-18 Před 8 měsíci

    student = True
    print(student)
    print(type(student))
    student = str(student)
    print(student)
    print(type(student))
    True
    True

  • @Kumaraniket2212
    @Kumaraniket2212 Před 11 měsíci

    What is GPA full form?

  • @prizepig
    @prizepig Před rokem +2

    a random comment

  • @nerdface1260
    @nerdface1260 Před rokem

    "Type casting is easy"
    Also me: why code no work I spend 5 hours trying to solve and I saw this vid and I was at the problem💀

  • @Mastodonte71
    @Mastodonte71 Před rokem

    random comment :)

  • @sainishantbiradar8022
    @sainishantbiradar8022 Před 4 měsíci

    Random comment

  • @Xomeyphen
    @Xomeyphen Před rokem

    A Random Comment

  • @rudrokinngzx8341
    @rudrokinngzx8341 Před 10 měsíci

    random comment

  • @daydarasensei12
    @daydarasensei12 Před rokem

    RANDOM COMMENT( ̄▽ ̄)

  • @RahulSingh-xd4qj
    @RahulSingh-xd4qj Před rokem

    random

  • @umcanalsemvidanoyoutube8840
    @umcanalsemvidanoyoutube8840 Před 11 měsíci

    You now how numpy casting works in your C source code?

  • @radinahmadi2211
    @radinahmadi2211 Před 4 měsíci

    I love you

  • @The_spaceguy
    @The_spaceguy Před 4 měsíci

    Random comment

  • @kalvinistheb0mb
    @kalvinistheb0mb Před rokem

    random comment