Conditional Statements - Python | Lesson 9 (Free Coding Bootcamp)

preview_player
Показать описание
Free Coding Bootcamp - Go from Zero to Software Engineer

This Bootcamp will follow the roadmap covered in this video

In this lesson, we go over conditional statements so that we can handle complicated logic. We also talk about the input() function so that we can prompt the user for input.

🔥 Drop a comment to help the algorithm :)
👍 Subscribe to get notifications for the next video

-----------------
😎 Resources
-----------------
👯 TikTok
📸 Instagram
💬. Join the Discord
📜. FREE Resume Template
📕. FREE Note taking template

-----------------
👾 Important Videos
-----------------

-----------------
🧑🏻‍💻 About Me
-----------------
I am a full time iOS engineer, with over 7 years of programming experience.
My goal is teach you the bare minimum necessary to break into tech ASAP.

Learn more about my programming journey

I offer 1 on 1 mentorship as well, feel free to DM me on discord

#coding #bootcamp #learntocode #codewithvincent

-----------------
Chapters
-----------------
0:00 Introduction
0:34 Weather example
1:20 If statement
2:23 Else statement
3:25 Else if statement
4:05 Conditional Statement template
4:23 Coding time
6:27 Create a function for reusability
7:28 input() function
9:20 Cast input to integer with int()
10:43 Use AND, OR to join statements together
12:05 Cheatsheet
Рекомендации по теме
Комментарии
Автор

I remember when conditionals in programming used to be really difficult for me to grasp. It took me a while, but when I realized that we use conditional statements in speech with our friends all the time, I immediately understood how they work in programming.

The introduction in this lesson is excellent, because it helps the learner realize that we humans use conditional statements in our lives all the time.

Talking about the weather and how to react to it is such a vivid example of how powerful and mundane if-then statements are. This kind of an introduction helps the learner see the connection between programming and everyday language.

excitedaboutlearning
Автор

I started again and this time I'm doing a few videos a day! Lessons 6-9 were great!

John-PaulMagyari
Автор

That cheat sheet is great! Saved it for future reference, thanks!

bho
Автор

Hey Vincent! I got this far, everything's going well. A lot of this has been really similar and kind of like review, since I took a programming course learning C, since I am in engineering. To be completely honest, everything from conditional statements and beyond started to not be fun for me in C 💀. Arguably, even functions and onwards was rough. But I am really grateful how you explain things really well with real life and silly examples. Just wanted to "check in" so to speak, I'm still here!

gabrieltorresrecinos
Автор

thank you so make for this series❤❤
i really love ur way of teaching it's simplified and not boring and the fact that u recommended us replit to use made it much much easier for me to practice especially with my slow internet connection🐢🐢

CoolName
Автор

Another great vid! Fast but that's why God gave us the pause button!!!

robbyv
Автор

At 6:35, how did you automatically indent all the lines? What's the secret!

goodhuman
Автор

question at 6:38 how did you indent the lines so fast, what was the shortcut you used, i had to do it manually putting spaces in?
thanks!

oliurrahman
Автор

for some reason could not comment on your previous video. but keep your head up king.

charlesopoku
Автор

@4:32 you verbally state semicolon but type colon. There's nothing worse than trying to debug at 4am and the project is due the next day, and the syntax error is ; instead of : 🧐

m-mcwrath
Автор

Thank you ❤❤❤ spent alot practicing and i love the breakdown of the lesson from the intro

txsy-system
Автор

Hi, Vincent thank you for your videos. I wanted to ask what if we wanted the rating to only appear after the user answers the weather question if that makes sense . thanks again, I am learning a lot from your videos

golyyyz
Автор

i was struggling for a bit but i got it now

mahanaimfessahye
Автор

Hello sir, I was just wondering if when can I use python in a project, Will it be included upon this whole series?

deed_it
Автор

what if after writing "sunny" in the terminal comes back as a syntax error saying "sunny" is not defined?

mrs
Автор

would it be considered unclean code if you do def whatIsTheWeather():

Osandha_
Автор

Hey Vince,
I just wanted to know if it supposed to "Sunny but Sad" everytime the rating is 1.

For example

What ist the Weather?
A: Meatballs
How was your day?
A: 1
Sunny but Sad


Thats the output i get everytime i use the rating 1 now. Can you help me fix this issue.

My english is not the best i would appreciate it if you could keep your anwser as simple as possible.

Thanks in advance :)

sannys.
Автор

i was confused because i made a meatball = cool algorithm and I used if answer = y... and realised and didn't realise i changed the variable answer to y in a conditional statement

cerfmanager
Автор

How do you put a "conditon" lol

AlejandroMartinez-bvtv
Автор

hi, Vincent! i cant seem to solve the error in my code, how can I combine 'if' branches using logical 'or' operator in line 10 and 14. thank you
1 def whatIsTheTasteOfTheSoup (taste, umami):
2 if taste == "salty":
3 print("salty")
4 if umami < 3:
5 print("angry")
6 else:
7 print ("happy")
8 elif taste == "bland" and umami < 3:
9 print("angry")
10 elif taste == "bland" and umami == 2:
12 print("happy")
13 elif taste == "sweet" and umami == 3:
14 print("happy")
15 elif taste == ("sweet") and umami > 2:
print("angry")
else:
print("fuck you")
taste = input("what is the taste of the soup?")
umami = int("rate the taste from 1-5")
whatIsTheTasteOfTheSoup(taste, umami)

kbnjebs