Phyton 1

Oct 15, 2013 12:17

Что то мне сдаётся, что вставлять if внутрь другого if не самое правильное действие. Но раз по условиям задачи требуется, придётся наступить на горло своей песне:

…in this case, it makes more sense tonest the new if block inside the ifpart of the existing if/else. This means that the whole if/else that you will create here goes inside the if part of your existing if/else block.

A nested if/else looks like this:

if condition:
if other_condition:
# Do something
else:
# Do something else!
else:
# Do yet another thing

Програмирование

Previous post Next post
Up