Python Tutorial 6: How to Use If Statements and Conditionals in Python

preview_player
Показать описание
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

In this video we show step-by-step instructions on how to use if statements, conditionals, and compound conditionals in python. I do not assume you are an expert, so these lessons are designed for complete beginners.
#Python
#Lessons
#Programming
Рекомендации по теме
Комментарии
Автор

I am a college student who had to put school on pause for a bunch of complicated reasons so I am currently working 10hrs a day doing IT and I really love these, when I am at my desk I can watch Mr. McWhorter with a cup of black coffee and I can keep learning and I don't feel like I am throwing away my time Thank you. When I can afford to I will be joining your patreon to pay you for this amazing service you provide.

ElijahBeachy
Автор

Thanks for another great lesson. The window management your doing is great. Just the fact that you care about it says everything to me. Support this great teacher guys, he deserves it! See you next week Paul ☕😉

stephanvb
Автор

0:00 Intro
0:58 Recap
2:17 What we are gonna learn…
6:00 1st Example
12:15 2nd Example
15:16 3rd Example
17:50 Homework
20:14 Homework Solution

nicolasbassano
Автор

I felt like a genius after figuring this out on my own😂 Great Lesson!

kck.Schrodinger
Автор

Its not just your teaching that I love.You want people that you barely know to learn well and excel in their lives. That much is clear from the way you motivate people to do the assigned homework. In India we call such a person a GURU.

premprasad
Автор

Sir, really very fortunate to get you in YouTube.. Learn not only code but also type of quality teaching from you.

pralaymajumdar
Автор

Thank you for your lessons:) You make Python very easy to learn!

myNumber=float(input('Please Input your number'))
if (myNumber== 7):
print('You are lucky')
if (myNumber != 7):
print('You are unlucky')

thepolishsewingbee
Автор

this is the best python tutorials i've seen on yt so far 10/10

faigelsworld
Автор

number=float(input('Please enter your number: '))
if number%2 == 0:
print('Your number is even')
if number%2 > 0:
print('Your number is odd')
Paul, a shorter way to do it without the rem variable. Great series as usual

rogthedodge
Автор

I paused and did my homework! I knew I had to use the mod somehow but it took a while for my old brain cells to figure it out! Apart from variable names, my solution was almost identical to yours. By the way, "an" and not "and" in front of

andrewhodson
Автор

Not a mathematician, but can say with a very high level of confidence that 0 is most definitely an even number.
That's my only comment about this video, everything else is great! Keep up the good work!

JackVersey
Автор

I jumped over here from the Raspberry Pi lessons to get better python programming skill before continuing the Pi lessons. Thanks for all of the great material.

wilsonlittle
Автор

Great lesson as always! I forgot about the % operator and so I the homework as shown below. Note, that I needed to keep changing the variable type to get a good, clean sentence format in my final prints.

### Homework ###
#Get number fro the user and tell user if number is even or odd.

Number = float(input('Please enter your integer: '))
x = Number / 2
y = int(x)
Numberint = int(Number)
Numberstr = str(Numberint)
if (x == y):
print('Your number, ', Numberstr + ', ', 'is an even number.')
if (x != y):
print("Your number, ", Numberstr + ', ', 'is an odd number.')

jonathanlanders
Автор

Hey Paul, I am an Aerospace Engineering graduate student trying to learn python and these videos have been awesome! Also, Christian and black coffee drinker here as well! 😁

spencerrichardson
Автор

Got it without folding like that lawn chair! That was satisfying, the mod function does come in handy!

TheSudouser
Автор

Thank you for these Mr. McWhorter, you are a God-sent.

midvnxd
Автор

I think I guessed ahead to the next lesson, but I used an 'and' condition to check if the inputted number was both greater than 0 and the remainder was equal to zero for an even number, and gave zero it's own print message because everyone is a comedian. I'm seriously loving this series, Paul!

ModernDayWanderlust
Автор

Thanx for that, got my old brain moving again. My first test was for zero and called it an "ODD" number right off the bat. Hope your move goes well.

John-vwwj
Автор

Hi Paul, I remembered what you said about the MOD function and worked out this homework on my own. I didn't include the "Please Play Again" but added it later. Thanks again.

alfredcalleja
Автор

Thanks for the lesson on IF. I tried to see if a program can be written that will show if a number is divisible by 9 using the same format as you have displayed. It worked! I thumped my chest and now there seem to be two Huckleberrys running around.

kevindegoede
welcome to shbcf.ru