ساختار شرطی در پایتون در صورتی که بخواهیم شروط مختلفی را ضمن یک ساختار شرطی بررسی کنیم از elif استفاده می کنیم. فرض کنیم می خواهیم نمره یک دانش آموز را در سه حالت بزرگتر از 10 مساوی 10 و کوچکتر از 10 مقایسه کنیم. حاصل چیزی شبیه به زیر خواهد بود: grade=15 if grade > 10 : print("Greater than 10") elif grade == 10 : print("equal to 10") elif grade < 10 : print("less than 10") چند نکته: به ساختار تو رفتگی ها در دستور if دقت کنید. هر کدام از این تو رفتگی ها (که بعد از علامت : در خط قبل قرار دارد) یک بلوک را تشکیل می دهد. برای مقایسه تساوی باید از == استفاده کنید (علامت = باعث ایجاد خطا می شود. = برای انتصاب است) در صورتی که بخواهید ذیل یک شرط چندین خط کد بنویسید باید تو رفتگی را برای تمام خطوط آن بلوک رعایت نمایید.
ساختار شرطی در پایتون در صورتی که بخواهیم شروط مختلفی را ضمن یک ساختار شرطی بررسی کنیم از elif استفاده می کنیم. فرض کنیم می خواهیم نمره یک دانش آموز را در سه حالت بزرگتر از 10 مساوی 10 و کوچکتر از 10 مقایسه کنیم. حاصل چیزی شبیه به زیر خواهد بود: grade=15 if grade > 10 : print("Greater than 10") elif grade == 10 : print("equal to 10") elif grade < 10 : print("less than 10") چند نکته: به ساختار تو رفتگی ها در دستور if دقت کنید. هر کدام از این تو رفتگی ها (که بعد از علامت : در خط قبل قرار دارد) یک بلوک را تشکیل می دهد. برای مقایسه تساوی باید از == استفاده کنید (علامت = باعث ایجاد خطا می شود. = برای انتصاب است) در صورتی که بخواهید ذیل یک شرط چندین خط کد بنویسید باید تو رفتگی را برای تمام خطوط آن بلوک رعایت نمایید.
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 has exploded as a hub for cybercriminals looking to buy, sell and share stolen data and hacking tools, new research shows, as the messaging app emerges as an alternative to the dark web.An investigation by cyber intelligence group Cyberint, together with the Financial Times, found a ballooning network of hackers sharing data leaks on the popular messaging platform, sometimes in channels with tens of thousands of subscribers, lured by its ease of use and light-touch moderation.Python4Finance from nl