Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Ordinal Adjectives | Python if-elif-else Statement
Conditional Statements in Python Clone

Glissez pour afficher le menu

book
Challenge: Ordinal Adjectives

Tâche

Swipe to start coding

You need to create a program that generates ordinal adjectives for each number from the following list: [1, 2, 3, 4, 5, 6, 7, 8, 9]. Your program should produce the following output:

number1 - 1st
number2 - 2nd
number3 - 3rd
number4 - 4th
number5 - 5th
number6 - 6th
number7 - 7th
number8 - 8th
number9 - 9th

It's essential to observe the pattern of this scheme and determine the correct endings for each number. Utilize if-elif-else statements within a for-loop to accomplish this task.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 3
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

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

close

Awesome!

Completion rate improved to 5.88

book
Challenge: Ordinal Adjectives

Tâche

Swipe to start coding

You need to create a program that generates ordinal adjectives for each number from the following list: [1, 2, 3, 4, 5, 6, 7, 8, 9]. Your program should produce the following output:

number1 - 1st
number2 - 2nd
number3 - 3rd
number4 - 4th
number5 - 5th
number6 - 6th
number7 - 7th
number8 - 8th
number9 - 9th

It's essential to observe the pattern of this scheme and determine the correct endings for each number. Utilize if-elif-else statements within a for-loop to accomplish this task.

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

close

Awesome!

Completion rate improved to 5.88

Glissez pour afficher le menu

some-alt