Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
If/else expressions with multiple conditions (2/2) | Conditional statements
Learn Python from Scratch
course content

Зміст курсу

Learn Python from Scratch

Learn Python from Scratch

1. The basics
2. Arithmetic operations
3. Common data types
4. Conditional statements
5. Other data types
6. Loops
7. Functions

If/else expressions with multiple conditions (2/2)

Remember the task you completed two chapters ago. There you wrote if/else statement to check whether the number is even or odd. This time let's modify it so now it will detect zeros and negative numbers.

Завдання

Modify your code (from the exercise about checking if the number is even or odd) so it will detect zero and print the message "This is null" and negative numbers with message "This number is negative". Think carefully about the order of conditions.

Завдання

Modify your code (from the exercise about checking if the number is even or odd) so it will detect zero and print the message "This is null" and negative numbers with message "This number is negative". Think carefully about the order of conditions.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 4. Розділ 6
toggle bottom row

If/else expressions with multiple conditions (2/2)

Remember the task you completed two chapters ago. There you wrote if/else statement to check whether the number is even or odd. This time let's modify it so now it will detect zeros and negative numbers.

Завдання

Modify your code (from the exercise about checking if the number is even or odd) so it will detect zero and print the message "This is null" and negative numbers with message "This number is negative". Think carefully about the order of conditions.

Завдання

Modify your code (from the exercise about checking if the number is even or odd) so it will detect zero and print the message "This is null" and negative numbers with message "This number is negative". Think carefully about the order of conditions.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 4. Розділ 6
toggle bottom row

If/else expressions with multiple conditions (2/2)

Remember the task you completed two chapters ago. There you wrote if/else statement to check whether the number is even or odd. This time let's modify it so now it will detect zeros and negative numbers.

Завдання

Modify your code (from the exercise about checking if the number is even or odd) so it will detect zero and print the message "This is null" and negative numbers with message "This number is negative". Think carefully about the order of conditions.

Завдання

Modify your code (from the exercise about checking if the number is even or odd) so it will detect zero and print the message "This is null" and negative numbers with message "This number is negative". Think carefully about the order of conditions.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Remember the task you completed two chapters ago. There you wrote if/else statement to check whether the number is even or odd. This time let's modify it so now it will detect zeros and negative numbers.

Завдання

Modify your code (from the exercise about checking if the number is even or odd) so it will detect zero and print the message "This is null" and negative numbers with message "This number is negative". Think carefully about the order of conditions.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 4. Розділ 6
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt