Logical operators in Python are easy ☀️

Sdílet
Vložit
  • čas přidán 16. 10. 2022
  • #python #code #tutorial
    Python logical operators and or not tutorial example explained

Komentáře • 65

  • @BroCodez
    @BroCodez  Před rokem +23

    # logical operators = used on conditional statements
    # and = checks two or more conditions are True
    # or = checks if at least one condition is True
    # not = True if condition is False, and vice versa
    temp = 20
    sunny = True
    if temp = 30:
    print("The temperature is bad")
    else:
    print("The temperature is good")
    if not sunny:
    print("It is cloudy")
    else:
    print("It is sunny")

  • @LoafHigh_
    @LoafHigh_ Před rokem +32

    I found your video after months of studying python and I gotta that it's helping me a ton. I am actually realizing that this might not be impossible to learn. Thanks bro code.

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

    Thank you for this video, due to you using the logical operators in real life circumstances, I was able to get my head around it, thanks again!

  • @user-pc6bg8kh5v
    @user-pc6bg8kh5v Před 11 měsíci +2

    Another helpful video from you!!!

  • @paisz3299
    @paisz3299 Před rokem +7

    Your vidoes helped me more than my uni

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

    Great video, short and simple.

  • @rongwu8264
    @rongwu8264 Před 20 dny

    This made Python really easy to learn

  • @user-xt1mr3is8w
    @user-xt1mr3is8w Před 2 dny

    Thank you! this video was so helpful.

  • @PSIwolf39
    @PSIwolf39 Před 7 měsíci +3

    Here's some code I made with logical operators in python:
    import math
    obedient = True
    userInput = int(input(f"pick a number from one to five (no decimal places): "))
    if userInput == 2 or userInput == 4:
    print(f"You picked an even number!")
    elif userInput > 5 or userInput < 1:
    print(f"That was not a valid option!")
    obedient = False
    else:
    print(f"You picked an odd number!")
    userInput = int(input(f"now select a number that is between 12 and 18: "))
    if userInput > 12 and userInput < 18:
    print(f"YAY, YOU DID WHAT I ASKED! (at least one time)")
    else:
    print(f"That is not what I asked you to do.")
    obedient = False
    if not obedient:
    print(f"You are disobedient.")
    else:
    print(f"Thank you for cooperating with me!")
    # print(f"HAPPY NEW YEAR!")

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

    NICELY DONE...❤

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

    Well done and thank you

  • @Mclffshorts1408
    @Mclffshorts1408 Před 5 měsíci +2

    Iam form India i am so understanding ur videos thanks for teaching courses form youtube

  • @dineshgautam7027
    @dineshgautam7027 Před rokem

    You are great....

  • @wmstram1
    @wmstram1 Před rokem

    Watched it. Liked it.

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

    Tysm bro im been trying to understand it for a while

  • @al-cadaalachannel3194

    Grateful 🙏

  • @TypicalVole2437
    @TypicalVole2437 Před rokem

    thanks this was easy

  • @teebs2721
    @teebs2721 Před rokem +1

    cool Bro Code

  • @henryloyd6175
    @henryloyd6175 Před rokem

    Thanks bro

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

    Bro code. Merry me.
    Thanks bro helpful video. appreciate it

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

    awesome video

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

    thanks g

  • @madhukaabhishek4452
    @madhukaabhishek4452 Před rokem

    Thans Bro

  • @inkbythebarrelandpaperbyth6905

    Legend man

  • @Hallandfan847
    @Hallandfan847 Před rokem +1

    IM THIRD OMG, COOL BRO CODE

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

    i gotta a question . what if i write the temp is more than 30 or less than 0 , "NOT" logical operator doesn't show in the output .Could anyone explain it to me please ?

  • @sofneo4454
    @sofneo4454 Před rokem

    Love u

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

    the fact that i figured out what "and " was two videos ago😍😍

  • @earlchesterantonio1581
    @earlchesterantonio1581 Před rokem +1

    Can you do some tutorials about rust too? Btw I love you videos man.

  • @merouanebelrhiti893
    @merouanebelrhiti893 Před rokem +1

    You are the best We need a ethical hacking course !!

    • @BroCodez
      @BroCodez  Před rokem +4

      Sorry I'm not an ethical hacker

    • @merouanebelrhiti893
      @merouanebelrhiti893 Před rokem +1

      @@BroCodez ok bro keep up the good work 👏 we are learning from you a lot 🙌 ,im from Morocco by the way 👍 ❤️

    • @merouanebelrhiti893
      @merouanebelrhiti893 Před rokem +2

      @@BroCodezEnglish is my 4th language and i understand everything you explained thanks 😊

    • @eliseanghel3556
      @eliseanghel3556 Před rokem

      I agree, we need it asap

  • @Gandalf17
    @Gandalf17 Před rokem +6

    idk why i struggle with the NOT operator

  • @big_brein
    @big_brein Před rokem +1

    I'm early?!

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

    okay, your channel name is so damn good HAHAHAHAHA!!! Also you explained things very well!

  • @eureka1251
    @eureka1251 Před rokem +3

    Hello, can you do video about spring in java?

    • @BroCodez
      @BroCodez  Před rokem +1

      I'm not sure if people would watch it

    • @eureka1251
      @eureka1251 Před rokem +1

      @@BroCodez This is very useful, java developer should know about spring, you want to explain well and clearly!

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

    when i try to make variable = input it gives me....... TypeError: '>=' not supported between instances of 'builtin_function_or_method' and 'int'........ any help please

    • @reziiuk
      @reziiuk Před 10 měsíci +1

      same are you using 3.11

  • @Fastdaveone
    @Fastdaveone Před 27 dny

    I don't know why but my brain just cant understand the "not" operator and I've asked every ai in existence to try to explain it to me and I still don't under staged it ,can you maybe try to explain it pls thank you .

  • @yousseef4012
    @yousseef4012 Před rokem

    We need solidity course please

    • @BroCodez
      @BroCodez  Před rokem

      Sorry I'm not familiar with Solidity

    • @yousseef4012
      @yousseef4012 Před rokem

      @@BroCodez you failed me bro 💔

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

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

    is it just me or with the not it isnt making sense

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

      Bro same if you understood please explain me i have exam tommorow

    • @krissbeyonna8918
      @krissbeyonna8918 Před 6 měsíci +2

      simply just
      if not true then false
      if true then true
      if not false then true

    • @spandanganguli6903
      @spandanganguli6903 Před 8 dny

      ​@@vivekvuyyuru9214 I hope you did well.

  • @RGGBMGO
    @RGGBMGO Před rokem

    Why are you making another python series

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

    Im the 1k liked lmao

  • @arshiaa104
    @arshiaa104 Před rokem

    Comment