✅ متغیرها (variables) متغیرها محفظههایی برای ذخیره مقادیر دادهها هستند.
🔴 ایجاد متغیرها پایتون هیچ فرمانی برای اعلان متغیر ندارد. یک متغیر در لحظهای ایجاد میشود که برای اولین بار یک مقدار به آن اختصاص میدهید. ⬅️مثال: x = 5 y = "John"
🟡 متغیرها نیازی به اعلان با نوع خاصی ندارند و حتی بعد از تنظیم میتوانند نوع خود را تغییر دهند. ⬅️ مثال: x = 4 # یک عدد است x x = "Sally" # یک رشته است x حالا print(x)
✅ انتخابکردن (casting) اگر میخواهید نوع داده یک متغیر را مشخص کنید، این کار را می توان با casting انجام داد.
x = str(3) y = int(3) z = float(3)
✅ نوع را دریافت کنید. شما می توانید نوع داده یک متغیر را با تابع type() دریافت کنید.
⬅️ مثال x = 5 y = "John" print(type(x)) print(type(y)) خروجی پایتون: <class 'int'> <class 'str'> 👈 ادامه دارد....
✅ متغیرها (variables) متغیرها محفظههایی برای ذخیره مقادیر دادهها هستند.
🔴 ایجاد متغیرها پایتون هیچ فرمانی برای اعلان متغیر ندارد. یک متغیر در لحظهای ایجاد میشود که برای اولین بار یک مقدار به آن اختصاص میدهید. ⬅️مثال: x = 5 y = "John"
🟡 متغیرها نیازی به اعلان با نوع خاصی ندارند و حتی بعد از تنظیم میتوانند نوع خود را تغییر دهند. ⬅️ مثال: x = 4 # یک عدد است x x = "Sally" # یک رشته است x حالا print(x)
✅ انتخابکردن (casting) اگر میخواهید نوع داده یک متغیر را مشخص کنید، این کار را می توان با casting انجام داد.
x = str(3) y = int(3) z = float(3)
✅ نوع را دریافت کنید. شما می توانید نوع داده یک متغیر را با تابع type() دریافت کنید.
⬅️ مثال x = 5 y = "John" print(type(x)) print(type(y)) خروجی پایتون: <class 'int'> <class 'str'> 👈 ادامه دارد....
"For Telegram, accountability has always been a problem, which is why it was so popular even before the full-scale war with far-right extremists and terrorists from all over the world," she told AFP from her safe house outside the Ukrainian capital. "Russians are really disconnected from the reality of what happening to their country," Andrey said. "So Telegram has become essential for understanding what's going on to the Russian-speaking world." "The result is on this photo: fiery 'greetings' to the invaders," the Security Service of Ukraine wrote alongside a photo showing several military vehicles among plumes of black smoke. Just days after Russia invaded Ukraine, Durov wrote that Telegram was "increasingly becoming a source of unverified information," and he worried about the app being used to "incite ethnic hatred." In the past, it was noticed that through bulk SMSes, investors were induced to invest in or purchase the stocks of certain listed companies.
from hk