Learn Python Programming - 18 - Logical AND OR NOT

preview_player
Показать описание
Exercises and Resources

Let's cover logical AND OR NOT ...
...
★☆★ FREE Lesson 1: The Most Important Thing For a Successful Programmer★☆★

Enroll for coding exercises, projects, tutorials, and courses...
Clever Programmer
Snapchat ► Rafeh1
Рекомендации по теме
Комментарии
Автор

That image is confusing maybe it's best explained like this.

"AND" = both have to be true to be true.

True and true = true
True and false = false
False and true = false
False and false = false

"OR" = just one has to be true to return true.

True or true = true
True or false = true
False or True = true
False or false = false

"NOT" = opposite of each other

Not true = false
Not false = true

In case someone watching this still doesn't get it.

InFamousCzr
Автор

You have a natural gift and ability to explain programming in ways that are so understandable! You made something I was confused on so simple. Thank you!

pnfitness
Автор

Your an amazing teacher. Straight up. Pizza and poison, so simple yet so perfect.

williambuchanan
Автор

i was so confused about this last month and without even doing anything this sounds too simple

Zen-rwfz
Автор

15:08 Thank you for clarifying the "what's necessary" stuff with real life. It's much appreciated.

KidsLearnHTML
Автор

thank you SO much man! I was struggling so hard with the whole "not not false and true and false" junk. Your video summed it up perfectly for me. Mad respect my man!!

gore
Автор

Hi CP,
thank you for putting in the work!
I use "youtube lectures" like yours to expand my knowledge in certain areas next to my usual studies.
Very well done and easy to follow.
Keep it up!
Greetings from Germany :)

the_professional
Автор

This video helped me a lot, especially with the real-life examples. Thank you so much.

JevvyMedia
Автор

AMAZING!! Im taking free MIT Python courses - and you explain it perfectly ! Thank you

antonkorolev
Автор

actually 'True or poision' worked because as soon as python evaluated True, the or statement evaluates to True. If you would have done poision or True you would have gotten a traceback error. It's called short-circuiting. If the first part of the or statement is True it doesn't even evaluate the second part because the statement is True by definition of 'or'.

derrickandchelseamcfall
Автор

this was helpful and nice teacher
True

jaitelyg
Автор

def password_1():

print('please enter username and password')
tries = 0
while True:
username = input()
password = input()
if username == 'henki' and password == 'pass':
print('access granted')
elif tries >= 2:
print('access denied')
break
if tries < 2:
tries = tries + 1

password_1()

Henki
Автор

14:12 It's False OR True, you said False AND True.

MR_MAGUIRE.
Автор

Like the way you are teaching! Savior of the day~

juwu
Автор

this and or actually means bulean multiplication and addition where true is 1 and false is 0

saadmansakib
Автор

Hey man! I wanted to say throughout these series this has worked out for me but some of the things like slicing strings and == <> <= >= != didn't work is it because you need terminal for those type of stuff . And also idk how to search for files like that, i found idle when i located the file of python. CAn you please help on how to get pip, terminal and stuff like that and also why soe of the things doesn't work?
Thank You
( I watched like 8+ episodes of these series in my first day)

offzone
Автор

import turtle

my_turtle = turtle.Turtle()
my_turtle.speed (0)
# Lesson learnt is that, I have called the Turtle fuction in the defined fuction and eachtime the system run it as part of the defined fuction.
def sqy(length, angle):

my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.left(angle)
my_turtle.forward(length)
my_turtle.forward(length)

for i in range(101):
sqy(50, 90)
my_turtle.right(11)
#my_turtle = turtle.Turtle()
#my_turtle.forward(100)

mohamedmukhtar
Автор

use_input = [('What', 'WP'), ('is', 'VBZ'), ('your', 'PRP$'), ('name', 'NN'), ('?', '.')]
x = ('What', 'WP')
y = ('name', 'NN')
z = ('age', 'NN')
z and y in use_input
>>> True

How could that be? and what can I do to make sure it returns false when one of the variables is not in the use_input?

kurdobakur
Автор

Your site just kinda put us in the video of How i Leaned to Code in less then 2 months and it doesnt really enroll us how to enroll

combatxhoop
Автор

its showing the name true and false are not defined.i cant do this this operations please help me .i m using in windows
this true and false are appearing in black color but in u r video its in orange

preetamsaha