Telegram Group & Telegram Channel
🎲#گام_به_گام

💻 کدنویسی

⬅️ دستورات پایه در پایتون: قسمت سوم

نام‌های متغیر
یک متغیر می‌تواند یک نام کوتاه (مانند x و y) یا یک نام توصیفی‌تر (سن، نام کار، کل‌حجم) داشته باشد.

🔣 قوانین برای متغیرهای پایتون:
🟡نام متغیر باید با یک حرف یا کاراکتر زیرخط شروع شود
🟡نام متغیر نمی‌تواند با یک عدد شروع شود
نام متغیر فقط می‌تواند شامل نویسه‌های عددی و زیرخط باشد (A-z، 0-9 و _ )
🟡نام متغیرها به حروف بزرگ و کوچک حساس هستند (age، Age و AGE سه متغیر متفاوت هستند)
🟡نام متغیر نمی‌تواند هیچ یک از کلمات کلیدی پایتون باشد.

◀️ مثال
متغیرهای درست:
myvar = "John"
my_var = "John"
_my_var = "John"
myVar = "John"
MYVAR = "John"
myvar2 = "John"
متغیرهای نادرست:
2myvar = "John"
my-var = "John"
my var = "John"

‼️ به یاد داشته باشید که نام متغیرها به حروف بزرگ و کوچک حساس هستند

📌 نام‌های متغیر چند کلمه‌ای
نام‌های متغیر با بیش از یک کلمه ممکن است به سختی خوانده شوند. چندین تکنیک وجود دارد که می‌توانید برای خوانایی بیشتر آنها استفاده کنید:

1️⃣ مورد شتر (Camel Case)
هر کلمه، به جز کلمه اول، با یک حرف بزرگ شروع می‌شود:
myVariableName = "John"

2️⃣ کیس پاسکال (Pascal Case)
هر کلمه با یک حرف بزرگ شروع می شود:
MyVariableName = "John"

3️⃣ کیس مار (Snake Case)
هر کلمه با یک کاراکتر زیر خط جدا شده است:
my_variable_name = "John"

👈 ادامه دارد....

#️⃣#کدنویسی
#️⃣#IDSchools
#️⃣#IDS
#️⃣#IDS_Math

✉️@IDSchools
✉️@IDS_Math
Please open Telegram to view this post
VIEW IN TELEGRAM



group-telegram.com/IDS_Math/103
Create:
Last Update:

🎲#گام_به_گام

💻 کدنویسی

⬅️ دستورات پایه در پایتون: قسمت سوم

نام‌های متغیر
یک متغیر می‌تواند یک نام کوتاه (مانند x و y) یا یک نام توصیفی‌تر (سن، نام کار، کل‌حجم) داشته باشد.

🔣 قوانین برای متغیرهای پایتون:
🟡نام متغیر باید با یک حرف یا کاراکتر زیرخط شروع شود
🟡نام متغیر نمی‌تواند با یک عدد شروع شود
نام متغیر فقط می‌تواند شامل نویسه‌های عددی و زیرخط باشد (A-z، 0-9 و _ )
🟡نام متغیرها به حروف بزرگ و کوچک حساس هستند (age، Age و AGE سه متغیر متفاوت هستند)
🟡نام متغیر نمی‌تواند هیچ یک از کلمات کلیدی پایتون باشد.

◀️ مثال
متغیرهای درست:
myvar = "John"
my_var = "John"
_my_var = "John"
myVar = "John"
MYVAR = "John"
myvar2 = "John"
متغیرهای نادرست:
2myvar = "John"
my-var = "John"
my var = "John"

‼️ به یاد داشته باشید که نام متغیرها به حروف بزرگ و کوچک حساس هستند

📌 نام‌های متغیر چند کلمه‌ای
نام‌های متغیر با بیش از یک کلمه ممکن است به سختی خوانده شوند. چندین تکنیک وجود دارد که می‌توانید برای خوانایی بیشتر آنها استفاده کنید:

1️⃣ مورد شتر (Camel Case)
هر کلمه، به جز کلمه اول، با یک حرف بزرگ شروع می‌شود:
myVariableName = "John"

2️⃣ کیس پاسکال (Pascal Case)
هر کلمه با یک حرف بزرگ شروع می شود:
MyVariableName = "John"

3️⃣ کیس مار (Snake Case)
هر کلمه با یک کاراکتر زیر خط جدا شده است:
my_variable_name = "John"

👈 ادامه دارد....

#️⃣#کدنویسی
#️⃣#IDSchools
#️⃣#IDS
#️⃣#IDS_Math

✉️@IDSchools
✉️@IDS_Math

BY ریاضی، آمار و علوم کامپیوتر - مدارس میان‌رشته‌ای


Warning: Undefined variable $i in /var/www/group-telegram/post.php on line 260

Share with your friend now:
group-telegram.com/IDS_Math/103

View MORE
Open in Telegram


Telegram | DID YOU KNOW?

Date: |

Channels are not fully encrypted, end-to-end. All communications on a Telegram channel can be seen by anyone on the channel and are also visible to Telegram. Telegram may be asked by a government to hand over the communications from a channel. Telegram has a history of standing up to Russian government requests for data, but how comfortable you are relying on that history to predict future behavior is up to you. Because Telegram has this data, it may also be stolen by hackers or leaked by an internal employee. Investors took profits on Friday while they could ahead of the weekend, explained Tom Essaye, founder of Sevens Report Research. Saturday and Sunday could easily bring unfortunate news on the war front—and traders would rather be able to sell any recent winnings at Friday’s earlier prices than wait for a potentially lower price at Monday’s open. Overall, extreme levels of fear in the market seems to have morphed into something more resembling concern. For example, the Cboe Volatility Index fell from its 2022 peak of 36, which it hit Monday, to around 30 on Friday, a sign of easing tensions. Meanwhile, while the price of WTI crude oil slipped from Sunday’s multiyear high $130 of barrel to $109 a pop. Markets have been expecting heavy restrictions on Russian oil, some of which the U.S. has already imposed, and that would reduce the global supply and bring about even more burdensome inflation. As such, the SC would like to remind investors to always exercise caution when evaluating investment opportunities, especially those promising unrealistically high returns with little or no risk. Investors should also never deposit money into someone’s personal bank account if instructed. Artem Kliuchnikov and his family fled Ukraine just days before the Russian invasion.
from in


Telegram ریاضی، آمار و علوم کامپیوتر - مدارس میان‌رشته‌ای
FROM American