Python Tutorial 8: Homework Solutions for Compound 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 solve the homework assignment from Lesson 7. I do not assume you are an expert, so these lessons are designed for complete beginners.
#Python
#Lessons
#Programming
Рекомендации по теме
Комментарии
Автор

Why would you dislike a tutorial that is so newbie friendly and so well made?

qnmhojr
Автор

I AM LEGEND! Thank you Paul, for proving that older foxes still can learn new tricks. I am addicted to your lessons: following Arduino (lesson 42, just finished writing the binary counter ON MY OWN) and Python at the same time. I feel that my Raspberry pi 3b, that has been gathering dust for years, will be booting very soon....

ludothequelormes
Автор

After 7 lectures, i finally got my first homework totally right!! Now i feel like a real pro. Can't describe how happy I am! :') thank you for your great tutorials. Pat pat on the chest for our hard work🌟

Moniaar_
Автор


i am the
i have successfully completed it.
love you from India.

sunil
Автор

Ho cheap lawn chairs here! I was able to do the homework. I loved your breakdown of the homework and want my students to use it. Another great video. Your videos should be used in every school!

hughpatterson
Автор

I finished your arduino lessons about a year ago and decided to take a look at python. Your a great teacher! God Bless.

Edu-tjep
Автор

Hi Paul, i'm new here :-), i'm completely new in the hobby-programming.... your are the first i found where i can completely understand and follow the proces of learning Python... so happy ! I have been following and practicing attentively. This is what I came up with for the exercise...:

give me your number : '))
rem=yourNumber%2
if rem==0:
print('Your number is even')
if rem==1:
print('Your number is odd')
if yourNumber<0:
print('Your number is NEGATIVE')
if yourNumber>0:
print('Your number is POSITIVE')
if yourNumber==0:
print('Your number is "0"')

then I saw your solution and that is indeed as it should be ;-)

hxfpprv
Автор

Love! Love! Love! the homework assignments!
So rewarding to learn from you and then be able to problem solve!
That feeling of accomplishment!!!
IT IS LEGEND!

TheScissorunner
Автор

I know I'm getting way ahead here, but I just wanted to share the approach I took to get the answer, and it was all thanks to your teaching in previous lessons that helped.

x = int(input("Pick a number: "))

def oddEve(x):
r = x%2
if r == 0:
r = "Even"
if r == 1:
r = "Odd"
return str(r)

def posNeg(x):
v = 0
if x > 0:
v = 'Positive'
if x < 0:
v = 'Negative'
return str(v)

if x == 0:
print("Your number is 0")
else:
print("You number is", posNeg(x), "and", oddEve(x))

You're the man, Paul!

tleavelle
Автор

I AM LEGEND! I got it right the first time with absolutely no mistakes. Great series. Thank you very much!

antrikshfulwani
Автор

I AM LEGEND!!! I even dealt with floating numbers. Thanks so much for these most excellent lessons, Paul!

cbrombaugh
Автор

I am Legend! Now to watch the rest of the video to see how our solutions differed. This added after watching: slightly different and just 11 lines of code. Great Job Paul!!

codecage
Автор

Hello Paul, I'm really enjoying your tutorials on Python. I won a Raspberry Pi Pico, and here I am learning Python. Learned a code way to concatenate strings and variables this morning that I thought I'd share.
//code
days = int(input('Please enter number of days: '))
hours = 24
minute = 60


def days_to_units():
total = days * hours * minute
print(f'{days} days is {total} minutes')

days_to_unit()
//end code


The f at the beginning tells Python to pay attention to what is in the braces { }. In this example it is the variable 'total'. I also learned how to create a function. Very neat and tidy.

seditiousmonkeyart
Автор

That's insane!! That's insane!!! There's a lot of variety present in your channel... I am blowed up by seeing your videos.

sahilsingh-xhjj
Автор

I did it on my own this time! I even remembered to float my input. My code isn't exactly the same but it still produces the same results so that's what counts. Thank you Mr. McWhorter

hoggboss
Автор

I am legend! Used different variable names but other the same as your solution. Once again, an awesome video.

andrewhodson
Автор

Paul, just so you know... my wife bought lawn chairs from WalMart over 10 years ago and they are holding up really well... 😊 (yes, I was also pleasantly surprised)

gordonspond
Автор

Wowww I'm a legend. I was able to do it on my on my own. I even remembered float.
My code isnot exactly the same but still produces the same results..

I'm so excited.
On my way to being a programmer

Thanks Mr Mcwhorter...

davidolowe
Автор

Hello Paul. Great lessons. Also a good starting point for an experienced developer who wants to learn a new programming language. I tried two approaches. Both worked. The smallest approach contains two lines of code. To achieve this I used the concept of ternary operators.

jacquesurlus
Автор

Hi Paul, the Python course just like the arduino course is briljiant. The way you present is in line with what we need to learn with regards to the engineering field. Absolutely briljiant. Thanks for all the effort you put in. Us older engineers tended to ignore the coding side of engineering but that cought up with me. No way to ignore this anymore!!!

mariusscheepers
join shbcf.ru