Logical operators in Python are easy 🔣

Поделиться
HTML-код
  • Опубликовано: 22 авг 2024
  • #python #code #tutorial
    Python logical operators and or not tutorial example explained

Комментарии • 65

  • @BroCodez
    @BroCodez  Год назад +24

    # 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_ Год назад +34

    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.

  • @Mclffshorts1408
    @Mclffshorts1408 6 месяцев назад +3

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

  • @PSIwolf39
    @PSIwolf39 7 месяцев назад +4

    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!")

  • @paisz3299
    @paisz3299 Год назад +7

    Your vidoes helped me more than my uni

  • @rongwu8264
    @rongwu8264 Месяц назад

    This made Python really easy to learn

  • @user-xt1mr3is8w
    @user-xt1mr3is8w 19 дней назад

    Thank you! this video was so helpful.

  • @user-pc6bg8kh5v
    @user-pc6bg8kh5v 11 месяцев назад +2

    Another helpful video from you!!!

  • @safimofi
    @safimofi 10 месяцев назад

    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!

  • @riderix5687
    @riderix5687 2 месяца назад

    thanks g

  • @Gandalf17
    @Gandalf17 Год назад +6

    idk why i struggle with the NOT operator

  • @joncaldwell4753
    @joncaldwell4753 2 месяца назад

    Well done and thank you

  • @johnyprigioni859
    @johnyprigioni859 11 месяцев назад

    Great video, short and simple.

  • @thiagogregory1
    @thiagogregory1 2 месяца назад

    awesome video

  • @gamers4dx
    @gamers4dx 8 месяцев назад

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

  • @teebs2721
    @teebs2721 Год назад +1

    cool Bro Code

  • @user-ly5we6xl4v
    @user-ly5we6xl4v 9 месяцев назад

    NICELY DONE...❤

  • @merouanebelrhiti893
    @merouanebelrhiti893 Год назад +1

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

    • @BroCodez
      @BroCodez  Год назад +4

      Sorry I'm not an ethical hacker

    • @merouanebelrhiti893
      @merouanebelrhiti893 Год назад +1

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

    • @merouanebelrhiti893
      @merouanebelrhiti893 Год назад +2

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

    • @eliseanghel3556
      @eliseanghel3556 Год назад

      I agree, we need it asap

  • @DaniCantBeStopped
    @DaniCantBeStopped 8 месяцев назад

    Tysm bro im been trying to understand it for a while

  • @earlchesterantonio1581
    @earlchesterantonio1581 Год назад +1

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

    • @BroCodez
      @BroCodez  Год назад +2

      thanks. I'm not sure if people would watch a Rust series tho

    • @earlchesterantonio1581
      @earlchesterantonio1581 Год назад

      Aww, that's sad

    • @WitherKing007
      @WitherKing007 5 месяцев назад

      Rust the game or am I just too stupid

    • @WitherKing007
      @WitherKing007 5 месяцев назад

      Oh it's a programming language

  • @wmstram1
    @wmstram1 Год назад

    Watched it. Liked it.

  • @dineshgautam7027
    @dineshgautam7027 Год назад

    You are great....

  • @al-cadaalachannel3194
    @al-cadaalachannel3194 Год назад

    Grateful 🙏

  • @TypicalVole2437
    @TypicalVole2437 Год назад

    thanks this was easy

  • @eureka1251
    @eureka1251 Год назад +3

    Hello, can you do video about spring in java?

    • @BroCodez
      @BroCodez  Год назад +1

      I'm not sure if people would watch it

    • @eureka1251
      @eureka1251 Год назад +1

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

  • @henryloyd6175
    @henryloyd6175 Год назад

    Thanks bro

  • @joaotgmendes
    @joaotgmendes 10 месяцев назад +9

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

    • @vivekvuyyuru9214
      @vivekvuyyuru9214 6 месяцев назад

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

    • @krissbeyonna8918
      @krissbeyonna8918 6 месяцев назад +2

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

    • @spandanganguli6903
      @spandanganguli6903 25 дней назад

      ​@@vivekvuyyuru9214 I hope you did well.

  • @Lit35
    @Lit35 9 месяцев назад

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

  • @DarkAcademyUniversity
    @DarkAcademyUniversity 6 месяцев назад

  • @thebid7357
    @thebid7357 10 месяцев назад

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

  • @madhukaabhishek4452
    @madhukaabhishek4452 Год назад

    Thans Bro

  • @sofneo4454
    @sofneo4454 Год назад

    Love u

  • @inkbythebarrelandpaperbyth6905

    Legend man

  • @Hallandfan847
    @Hallandfan847 Год назад +1

    IM THIRD OMG, COOL BRO CODE

  • @Fastdaveone
    @Fastdaveone Месяц назад

    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 .

  • @NPC_ghosttown
    @NPC_ghosttown 8 месяцев назад

    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 ?

  • @yousseef4012
    @yousseef4012 Год назад

    We need solidity course please

    • @BroCodez
      @BroCodez  Год назад

      Sorry I'm not familiar with Solidity

    • @yousseef4012
      @yousseef4012 Год назад

      @@BroCodez you failed me bro 💔

  • @roboro3
    @roboro3 11 месяцев назад

    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 10 месяцев назад +1

      same are you using 3.11

  • @big_brein
    @big_brein Год назад +1

    I'm early?!

  • @RGGBMGO
    @RGGBMGO Год назад

    Why are you making another python series

  • @arshiaa104
    @arshiaa104 Год назад

    Comment

  • @Lit35
    @Lit35 9 месяцев назад

    Im the 1k liked lmao