Telegram Group & Telegram Channel
Что выведет этот код и почему?

❗️ Ответ: 6. Объяснение:

1. В функции outer_func создается x со значением 2.

2. Следом объявляется функция inner_func, она не запоминает значение x или y сразу, а получит его только при ее использовании.

3. x становится равен x + 2, т.е. 4, объявляется y со значением 2

4. выполняется блок return (x(4) + y(2) = 6).

5. Несмотря на объявление значения y = 3, функция inner_func будет вызвана только после возвращения значения y = 2. Поэтому вывод будет равен 6.



@python_job_interview
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/python_job_interview/948
Create:
Last Update:

Что выведет этот код и почему?

❗️ Ответ: 6. Объяснение:

1. В функции outer_func создается x со значением 2.

2. Следом объявляется функция inner_func, она не запоминает значение x или y сразу, а получит его только при ее использовании.

3. x становится равен x + 2, т.е. 4, объявляется y со значением 2

4. выполняется блок return (x(4) + y(2) = 6).

5. Несмотря на объявление значения y = 3, функция inner_func будет вызвана только после возвращения значения y = 2. Поэтому вывод будет равен 6.



@python_job_interview

BY Python вопросы с собеседований




Share with your friend now:
tg-me.com/python_job_interview/948

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

China’s stock markets are some of the largest in the world, with total market capitalization reaching RMB 79 trillion (US$12.2 trillion) in 2020. China’s stock markets are seen as a crucial tool for driving economic growth, in particular for financing the country’s rapidly growing high-tech sectors.Although traditionally closed off to overseas investors, China’s financial markets have gradually been loosening restrictions over the past couple of decades. At the same time, reforms have sought to make it easier for Chinese companies to list on onshore stock exchanges, and new programs have been launched in attempts to lure some of China’s most coveted overseas-listed companies back to the country.

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

telegram from ms


Telegram Python вопросы с собеседований
FROM USA