Logical operators in Python are easy 🔣

preview_player
Показать описание
#python #code #tutorial

Python logical operators and or not tutorial example explained
Рекомендации по теме
Комментарии
Автор

# 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 <= 0 or 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")

BroCodez
Автор

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.

LoafHigh_
Автор

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

Mclffshorts
Автор

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

PSIwolf
Автор

Your vidoes helped me more than my uni

paisz
Автор

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!

safimofi
Автор

idk why i struggle with the NOT operator

Gandalf
Автор

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

joaotgmendes
Автор

Hello, can you do video about spring in java?

eureka
Автор

Tysm bro im been trying to understand it for a while

DaniCantBeStopped
Автор

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

earlchesterantonio
Автор

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

gamersdx
Автор

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 .

Fastdaveone
Автор

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

merouanebelrhiti
Автор

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

Lit
Автор

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

thebid
Автор

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 ?

NPC_ghosttown
Автор

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

roboro