Python Jumpstart by Building 10 Apps Transcripts
Chapter: App 4: Journal app and file I/O
Lecture: Core concept: Complex conditionals
0:00 These complex conditionals are one of our core concepts from this app,
0:04 so look at this code here.
0:06 We have a variable X, Y and Z.
0:11 And we would like to run something if X is somehow false,
0:14 either in number or boolean or something like this,
0:17 and the combination of Z is not 2 or Y is false, not Y, right,
0:24 so here is how you write that in Python.
0:26 We say if not x and (z != 2 or not y)
0:33 Now I think complex conditionals in Python make tons of sense,
0:37 and it's quite straightforward,
0:39 the one exception to this sort of English language version of boolean logic
0:44 where you say the words and or not is the not equal to
0:49 or greater than or less than parts,
0:52 so they sort of use symbols
0:53 but other than that think English when you are doing your conditionals.