Зміст курсу
Learn Python from Scratch
Learn Python from Scratch
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.
Дякуємо за ваш відгук!
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.
Дякуємо за ваш відгук!
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.
Дякуємо за ваш відгук!
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.