Multiple Conditional Statements In Python - #17

preview_player
Показать описание
How to use Multiple Conditional Statements In Python. In this video I'll teach you about MULTIPLE Conditional If/Else/Elif Statements in Python... doing more than one comparison in your conditional statement.

In this series I'll teach you to program with Python.
See My Python Playlist:

Subscribe to channel:

Рекомендации по теме
Комментарии
Автор

Python is quite forgiving.. your example of:
if (num > 10) or (num > 100):
can also be:
if (num > 10 or num > 100):
if num > 10 or num > 100:

I wasn't sure but had to try it out as I thought the second method was correct before today...

chrisingram
Автор

if i want to implements and and or in my code without using them how can i do that

kumailhassan
Автор

I have 80 or conditions that have to go after an if statement, Like:
if user_input=="abc" or "def" or "ghi" or "jkl" or "": (and this keeps going for 80 options.
how do I do this without having to write user_input== before each one of these 80 options?

Also I have many many a great many sinerios that use a great many conditional options like this. I think it is unrealistic to Limit people to 2 or 3 options.
What's you favorite color? Your only options are Red or Blue.
Now do you think that is fair when your favorite color is something other than Red or Blue?
Do you see how it is unrealistic to Limit people to 2 or three options when in the Real World the Options are Limitless?

Anyways, the program I am writing I want the user to input a Chapter of a Book.
Now you know in the Real world most Books have MORE than 2 or 3 Chapters.

So how can I write that if statement without having to write the
user_input==
before each and every chapter option?
Oh and also these chapters are not Numbers they are String Names.

arctictimberwolf
visit shbcf.ru