Telegram Group & Telegram Channel
# حلقة for
تستخدم في loop
في لغة بايثون تستخدم لتنفيذ سلسلة من الأوامر بشكل متكرر لعدة عناصر في تسلسل محدد.
تسمح لنا استخدام for
بتنفيذ نفس الكود لكل عنصر في التسلسل، وذلك بدون الحاجة إلى تكرار الأوامر يدويًا لكل عنصر.

فلنقم بتوضيح استخدام "for" مع بعض الأمثلة وتعريف

التعريف :
حلقة "for" في بايثون تستخدم لتكرار تنفيذ كود معين لكل عنصر في تسلسل. تستخدم لمعالجة وتحليل التسلسلات وتطبيق أوامر محددة على كل عنصر على حدة.

استخدامات "for" في لغة بايثون:
1. تنفيذ كود لكل عنصر في قائمة:
يعتبر هذا الاستخدام شائعًا لتنفيذ الأوامر للعناصر في قوائم. توفر "for" طريقة مريحة لتنفيذ نفس الكود لكل عنصر في القائمة.
مثال :
fruits = ["apple", "banana", "cherry"]

for fruit in fruits:
print(fruit)


Output :

apple
banana
cherry


2. تنفيذ كود لكل عنصر في سلسلة:
يمكن استخدام "for" لتنفيذ أوامر لكل حرف في سلسلة محددة.


word = "Hello"

for char in word:
print(char)


Output :

H
e
l
l
o


3. تنفيذ كود لعدد محدد من المرات:
باستخدام وظيفة
range()
في بايثون، يمكننا تكرار تنفيذ الأوامر لعدد محدد من المرات.


for i in range(5):
print(i)


Output:

0
1
2
3
4

#note

في loop يتم حساب الأرقام من "zero" "0"
مثلا في حساب العادي

12345
حساب loop
01234

لذلك نلاحظ تم توقف عند رقم 4 لانو بفعل تم طباعة 5 أرقام
اذا تريد إظهار الرقم كل عليك انك تزود واحد و هكذا.
:)
end

www.tg-me.com/hk/telegram/com.t3lampython

#note
إذا في شخص يريد يتعلم لغة برمجة dart
الخاصة بي flutter
يدخل على قناة عند اكتمال القناة 100 سوف يبدأ الشرح
Flutter
مختص ببرمجة وتطوير تطبيقات الهاتف أندرويد او ios
والأن المجال في تطور و يشمل أشياء كثيرة مثل web Applications و الخ etc
رابط القناة 👇

@t3lamdart

See you :)



tg-me.com/t3lampython/98
Create:
Last Update:

# حلقة for
تستخدم في loop
في لغة بايثون تستخدم لتنفيذ سلسلة من الأوامر بشكل متكرر لعدة عناصر في تسلسل محدد.
تسمح لنا استخدام for
بتنفيذ نفس الكود لكل عنصر في التسلسل، وذلك بدون الحاجة إلى تكرار الأوامر يدويًا لكل عنصر.

فلنقم بتوضيح استخدام "for" مع بعض الأمثلة وتعريف

التعريف :
حلقة "for" في بايثون تستخدم لتكرار تنفيذ كود معين لكل عنصر في تسلسل. تستخدم لمعالجة وتحليل التسلسلات وتطبيق أوامر محددة على كل عنصر على حدة.

استخدامات "for" في لغة بايثون:
1. تنفيذ كود لكل عنصر في قائمة:
يعتبر هذا الاستخدام شائعًا لتنفيذ الأوامر للعناصر في قوائم. توفر "for" طريقة مريحة لتنفيذ نفس الكود لكل عنصر في القائمة.
مثال :
fruits = ["apple", "banana", "cherry"]

for fruit in fruits:
print(fruit)


Output :

apple
banana
cherry


2. تنفيذ كود لكل عنصر في سلسلة:
يمكن استخدام "for" لتنفيذ أوامر لكل حرف في سلسلة محددة.


word = "Hello"

for char in word:
print(char)


Output :

H
e
l
l
o


3. تنفيذ كود لعدد محدد من المرات:
باستخدام وظيفة
range()
في بايثون، يمكننا تكرار تنفيذ الأوامر لعدد محدد من المرات.


for i in range(5):
print(i)


Output:

0
1
2
3
4

#note

في loop يتم حساب الأرقام من "zero" "0"
مثلا في حساب العادي

12345
حساب loop
01234

لذلك نلاحظ تم توقف عند رقم 4 لانو بفعل تم طباعة 5 أرقام
اذا تريد إظهار الرقم كل عليك انك تزود واحد و هكذا.
:)
end

www.tg-me.com/hk/telegram/com.t3lampython

#note
إذا في شخص يريد يتعلم لغة برمجة dart
الخاصة بي flutter
يدخل على قناة عند اكتمال القناة 100 سوف يبدأ الشرح
Flutter
مختص ببرمجة وتطوير تطبيقات الهاتف أندرويد او ios
والأن المجال في تطور و يشمل أشياء كثيرة مثل web Applications و الخ etc
رابط القناة 👇

@t3lamdart

See you :)

BY learn python { تعلم بايثون }




Share with your friend now:
tg-me.com/t3lampython/98

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

How to Buy Bitcoin?

Most people buy Bitcoin via exchanges, such as Coinbase. Exchanges allow you to buy, sell and hold cryptocurrency, and setting up an account is similar to opening a brokerage account—you’ll need to verify your identity and provide some kind of funding source, such as a bank account or debit card. Major exchanges include Coinbase, Kraken, and Gemini. You can also buy Bitcoin at a broker like Robinhood. Regardless of where you buy your Bitcoin, you’ll need a digital wallet in which to store it. This might be what’s called a hot wallet or a cold wallet. A hot wallet (also called an online wallet) is stored by an exchange or a provider in the cloud. Providers of online wallets include Exodus, Electrum and Mycelium. A cold wallet (or mobile wallet) is an offline device used to store Bitcoin and is not connected to the Internet. Some mobile wallet options include Trezor and Ledger.

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

telegram from hk


Telegram learn python { تعلم بايثون }
FROM USA