Telegram Group & Telegram Channel
Что выведет этот код?

В python циклы использует тот же scope (область видимости), в которой они объявлены и оставляют переменную после себя.

Почему не 0 и не 7?

Не 7, потому что range(stop) не включая stop, т.е. дойдет до 7-1 = 6.
Не 0, потому что цикл полностью отработал, т.е. дошел до 6.

Поэтому ответ 6.

#forloop



tg-me.com/pythrone/4
Create:
Last Update:

Что выведет этот код?

В python циклы использует тот же scope (область видимости), в которой они объявлены и оставляют переменную после себя.

Почему не 0 и не 7?

Не 7, потому что range(stop) не включая stop, т.е. дойдет до 7-1 = 6.
Не 0, потому что цикл полностью отработал, т.е. дошел до 6.

Поэтому ответ 6.

#forloop

BY PyThrone




Share with your friend now:
tg-me.com/pythrone/4

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

telegram from jp


Telegram PyThrone
FROM USA