Telegram Group & Telegram Channel
​​Назначение функций по условию

Наверняка большинство из вас знакомы с тернарным оператором, позволяющим записать простое условное выражение с if:

A = Y if X else Z

Интерпретатор выполняет выражение Y, если объект XTrue, и Z, если XFalse.

Но оказывается, тернарный оператор можно использовать не только для переменных, но и для функций.



tg-me.com/python_academy/54
Create:
Last Update:

​​Назначение функций по условию

Наверняка большинство из вас знакомы с тернарным оператором, позволяющим записать простое условное выражение с if:

A = Y if X else Z

Интерпретатор выполняет выражение Y, если объект XTrue, и Z, если XFalse.

Но оказывается, тернарный оператор можно использовать не только для переменных, но и для функций.

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/54

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

The SSE was the first modern stock exchange to open in China, with trading commencing in 1990. It has now grown to become the largest stock exchange in Asia and the third-largest in the world by market capitalization, which stood at RMB 50.6 trillion (US$7.8 trillion) as of September 2021. Stocks (both A-shares and B-shares), bonds, funds, and derivatives are traded on the exchange. The SEE has two trading boards, the Main Board and the Science and Technology Innovation Board, the latter more commonly known as the STAR Market. The Main Board mainly hosts large, well-established Chinese companies and lists both A-shares and B-shares.

Tata Power whose core business is to generate, transmit and distribute electricity has made no money to investors in the last one decade. That is a big blunder considering it is one of the largest power generation companies in the country. One of the reasons is the company's huge debt levels which stood at ₹43,559 crore at the end of March 2021 compared to the company’s market capitalisation of ₹44,447 crore.

Python Academy from us


Telegram Python Academy
FROM USA