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
セクション 4.  6
single

single

bookIf/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.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 4.  6
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt