# 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")
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.
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!")
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 ?
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
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 .
# 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")
Thanks
Bro tutor python 2024
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.
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!
Another helpful video from you!!!
Your vidoes helped me more than my uni
Great video, short and simple.
This made Python really easy to learn
Thank you! this video was so helpful.
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!")
NICELY DONE...❤
Well done and thank you
Iam form India i am so understanding ur videos thanks for teaching courses form youtube
me to also
You are great....
Watched it. Liked it.
Tysm bro im been trying to understand it for a while
Grateful 🙏
thanks this was easy
cool Bro Code
Thanks bro
Bro code. Merry me.
Thanks bro helpful video. appreciate it
awesome video
thanks g
Thans Bro
Legend man
IM THIRD OMG, COOL BRO CODE
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 ?
Love u
the fact that i figured out what "and " was two videos ago😍😍
Can you do some tutorials about rust too? Btw I love you videos man.
thanks. I'm not sure if people would watch a Rust series tho
Aww, that's sad
Rust the game or am I just too stupid
Oh it's a programming language
You are the best We need a ethical hacking course !!
Sorry I'm not an ethical hacker
@@BroCodez ok bro keep up the good work 👏 we are learning from you a lot 🙌 ,im from Morocco by the way 👍 ❤️
@@BroCodezEnglish is my 4th language and i understand everything you explained thanks 😊
I agree, we need it asap
idk why i struggle with the NOT operator
same bro .
I'm early?!
okay, your channel name is so damn good HAHAHAHAHA!!! Also you explained things very well!
Hello, can you do video about spring in java?
I'm not sure if people would watch it
@@BroCodez This is very useful, java developer should know about spring, you want to explain well and clearly!
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
same are you using 3.11
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 .
We need solidity course please
Sorry I'm not familiar with Solidity
@@BroCodez you failed me bro 💔
is it just me or with the not it isnt making sense
Bro same if you understood please explain me i have exam tommorow
simply just
if not true then false
if true then true
if not false then true
@@vivekvuyyuru9214 I hope you did well.
Why are you making another python series
because I want to
@@BroCodez 🗿
Im the 1k liked lmao
Comment