5️⃣ دستورات پایه در پایتون: قسمت پنجم ◀️ یک مجموعه را باز کنید. اگر مجموعهای از مقادیر در یک لیست، تاپل و غیره دارید، پایتون به شما اجازه میدهد که مقادیر را به متغیرها استخراج کنید. به این کار باز کردن بسته بندی (unpacking) میگویند.
🟡 مثال: fruits = ["apple", "banana", "cherry"] x, y, z = fruits print(x) print(y) print(z) خروجی پایتون apple banana cherry
⬅️ متغیرهای خروجی 🟣تابع ()print اغلب برای خروجی متغیرها استفاده میشود. 🟡 مثال: x = "Python is awesome" print(x) خروجی پایتون: Python is awesome
🟣در تابع ()print شما چندین متغیر را که با کاما از هم جدا شدهاند، خروجی میدهید: 🟡 مثال: x = "Python" y = "is" z = "awesome" print(x, y, z) خروجی پایتون: Python is awesome
🟣 همچنین میتوانید از عملگر + برای خروجی چندین متغیر استفاده کنید: 🟡 مثال: x = "Python " y = "is " z = "awesome" print(x + y + z) خروجی پایتون: Python is awesome
‼️ به کاراکتر Space بعد از "Python" و "is" توجه کنید، بدون آنها نتیجه "Pythonisawesome" خواهد بود.
🟣برای اعداد، کاراکتر + به عنوان یک عملگر ریاضی عمل میکند: 🟡 مثال: x = 5 y = 10 print(x + y) خروجی پایتون: 15
🟣در تابع ()print وقتی میخواهید یک رشته و یک عدد را با عملگر + ترکیب کنید، پایتون به شما یک خطا میدهد: 🟡 مثال: x = 5 y = "John" print(x + y) خروجی پایتون: TypeError: unsupported operand type(s) for +: 'int' and 'str'
🟣 بهترین راه برای خروجی چندین متغیر در تابع ()print جدا کردن آنها با کاما است که حتی از انواع دادههای مختلف پشتیبانی میکند: 🟡 مثال: x = 5 y = "John" print(x, y) خروجی پایتون: 5 John
5️⃣ دستورات پایه در پایتون: قسمت پنجم ◀️ یک مجموعه را باز کنید. اگر مجموعهای از مقادیر در یک لیست، تاپل و غیره دارید، پایتون به شما اجازه میدهد که مقادیر را به متغیرها استخراج کنید. به این کار باز کردن بسته بندی (unpacking) میگویند.
🟡 مثال: fruits = ["apple", "banana", "cherry"] x, y, z = fruits print(x) print(y) print(z) خروجی پایتون apple banana cherry
⬅️ متغیرهای خروجی 🟣تابع ()print اغلب برای خروجی متغیرها استفاده میشود. 🟡 مثال: x = "Python is awesome" print(x) خروجی پایتون: Python is awesome
🟣در تابع ()print شما چندین متغیر را که با کاما از هم جدا شدهاند، خروجی میدهید: 🟡 مثال: x = "Python" y = "is" z = "awesome" print(x, y, z) خروجی پایتون: Python is awesome
🟣 همچنین میتوانید از عملگر + برای خروجی چندین متغیر استفاده کنید: 🟡 مثال: x = "Python " y = "is " z = "awesome" print(x + y + z) خروجی پایتون: Python is awesome
‼️ به کاراکتر Space بعد از "Python" و "is" توجه کنید، بدون آنها نتیجه "Pythonisawesome" خواهد بود.
🟣برای اعداد، کاراکتر + به عنوان یک عملگر ریاضی عمل میکند: 🟡 مثال: x = 5 y = 10 print(x + y) خروجی پایتون: 15
🟣در تابع ()print وقتی میخواهید یک رشته و یک عدد را با عملگر + ترکیب کنید، پایتون به شما یک خطا میدهد: 🟡 مثال: x = 5 y = "John" print(x + y) خروجی پایتون: TypeError: unsupported operand type(s) for +: 'int' and 'str'
🟣 بهترین راه برای خروجی چندین متغیر در تابع ()print جدا کردن آنها با کاما است که حتی از انواع دادههای مختلف پشتیبانی میکند: 🟡 مثال: x = 5 y = "John" print(x, y) خروجی پایتون: 5 John
But because group chats and the channel features are not end-to-end encrypted, Galperin said user privacy is potentially under threat. During the operations, Sebi officials seized various records and documents, including 34 mobile phones, six laptops, four desktops, four tablets, two hard drive disks and one pen drive from the custody of these persons. Apparently upbeat developments in Russia's discussions with Ukraine helped at least temporarily send investors back into risk assets. Russian President Vladimir Putin said during a meeting with his Belarusian counterpart Alexander Lukashenko that there were "certain positive developments" occurring in the talks with Ukraine, according to a transcript of their meeting. Putin added that discussions were happening "almost on a daily basis." Soloviev also promoted the channel in a post he shared on his own Telegram, which has 580,000 followers. The post recommended his viewers subscribe to "War on Fakes" in a time of fake news. Crude oil prices edged higher after tumbling on Thursday, when U.S. West Texas intermediate slid back below $110 per barrel after topping as much as $130 a barrel in recent sessions. Still, gas prices at the pump rose to fresh highs.
from id