Telegram Group & Telegram Channel
ساختار شرطی در پایتون
توجه داریم، که elif در جایی به کار می رود که بخواهیم مجددا شرط دیگری را بررسی کنیم. اگر بخواهیم برای تمام حالت های باقیمانده تصمیم بگیریم از else استفاده می کنیم.
مثلا می خواهیم اگر اسم کاربر p1 یا p2 یا p3 بود پیام مناسب خود را دریافت کند و الا پیام خطا دریافت کند. حاصل چیزی شبیه زیر خواهد بود:
user = "p9"
if user=="p1":
print("welcome p1")
elif user=="p2":
print("welcome p2")
elif user=="p3":
print("welcome p3")
else:
print("Error, Anonymous")
#ساختار_شرطی
#آموزش_پایتون

#مقدمات

پایتون برای مالی در تلگرام https://www.tg-me.com/vn/Python4Finance/com.python4finance

پایتون برای مالی در بله https://ble.im/vn/Python4Finance/com.python4finance



tg-me.com/python4finance/38
Create:
Last Update:

ساختار شرطی در پایتون
توجه داریم، که elif در جایی به کار می رود که بخواهیم مجددا شرط دیگری را بررسی کنیم. اگر بخواهیم برای تمام حالت های باقیمانده تصمیم بگیریم از else استفاده می کنیم.
مثلا می خواهیم اگر اسم کاربر p1 یا p2 یا p3 بود پیام مناسب خود را دریافت کند و الا پیام خطا دریافت کند. حاصل چیزی شبیه زیر خواهد بود:
user = "p9"
if user=="p1":
print("welcome p1")
elif user=="p2":
print("welcome p2")
elif user=="p3":
print("welcome p3")
else:
print("Error, Anonymous")
#ساختار_شرطی
#آموزش_پایتون

#مقدمات

پایتون برای مالی در تلگرام https://www.tg-me.com/vn/Python4Finance/com.python4finance

پایتون برای مالی در بله https://ble.im/vn/Python4Finance/com.python4finance

BY Python4Finance




Share with your friend now:
tg-me.com/python4finance/38

View MORE
Open in Telegram


Python4Finance Telegram | DID YOU KNOW?

Date: |

What is Telegram?

Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.

The S&P 500 slumped 1.8% on Monday and Tuesday, thanks to China Evergrande, the Chinese property company that looks like it is ready to default on its more-than $300 billion in debt. Cries of the next Lehman Brothers—or maybe the next Silverado?—echoed through the canyons of Wall Street as investors prepared for the worst.

Python4Finance from vn


Telegram Python4Finance
FROM USA