Python Programming: Lesson 6 - In-Place Operators and Boolean Expressions

Published: 15 August 2021
on channel: youmils03
50
0

PLEASE SUBSCRIBE!!!

In the previous lesson (   • Python Programming: Lesson 5 - Reassi...  ), we studied the reassignment of variables after they were already created, as well as the collection of user input. In this lesson, we briefly review these critical concepts and then continue with in-place operators and boolean expressions.

In-place operators: There is a quicker way of reassigning a variable depending on its current value
x += 16 is a quicker way of writing x = x + 16
y //= 10 is a quicker way of writing y = y // 10
z += " dog" is a quicker way of writing z = z + " dog" for some string z

A boolean expression is one that evaluates to either True or False. For example, print( 5 + 2 == 10 ) would print False on the console. We can also combine boolean expressions. If a = True and b = False, then print( a && b ) would print False but print( a || b ) would print True.

1:25 Review of Reassigning Variables
3:20 Review of User Input
6:09 NEW: In-Place Operators
9:14 NEW: Boolean Expressions
14:21 NEW: Combining Boolean Expressions with and, or, not
18:18 PEEK: Boolean Variables

An equivalent lesson regarding boolean expressions in Java is available here:    • Java Programming: Lesson 8 - Boolean ...  

Ready for boolean variables and the if/else block? Check out lesson 7 here:    • Python Programming: Lesson 7 - Boolea...  

Thanks for watching, and PLEASE SUBSCRIBE!!!


Watch video Python Programming: Lesson 6 - In-Place Operators and Boolean Expressions online without registration, duration hours minute second in high quality. This video was added by user youmils03 15 August 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 50 once and liked it 0 people.