Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre If/elif/else | Control Flow
Introduction to Data Analysis in Python
course content

Contenu du cours

Introduction to Data Analysis in Python

Introduction to Data Analysis in Python

1. Basics
2. Data Types
3. Control Flow
4. Functions and Modules
5. Introduction to NumPy

book
If/elif/else

elif is used if the previous condition is not met, but the current one is.

12345678
price = 999 if price > 1000: print('The price is high. I won't buy it') elif price > 500: print('I will think if I need it') else: print('I will definitely buy it')
copy

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 4

Demandez à l'IA

expand
ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

course content

Contenu du cours

Introduction to Data Analysis in Python

Introduction to Data Analysis in Python

1. Basics
2. Data Types
3. Control Flow
4. Functions and Modules
5. Introduction to NumPy

book
If/elif/else

elif is used if the previous condition is not met, but the current one is.

12345678
price = 999 if price > 1000: print('The price is high. I won't buy it') elif price > 500: print('I will think if I need it') else: print('I will definitely buy it')
copy

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 4
Nous sommes désolés de vous informer que quelque chose s'est mal passé. Qu'est-il arrivé ?
some-alt