Warning: mkdir(): No space left on device in /var/www/tgoop/post.php on line 37

Warning: file_put_contents(aCache/aDaily/post/t3lampython/--): Failed to open stream: No such file or directory in /var/www/tgoop/post.php on line 50
learn python { تعلم بايثون }@t3lampython P.81
T3LAMPYTHON Telegram 81
#الدرس الثالث
3.4
*شرح float مع دالة input * مثال لحساب معدل الطلاب :

حساب معدل الطلاب
#code
# الكود باللغة الإنجليزية

subjects = float(input("Enter the number of subjects: "))
total_grade = 0.0

for i in range(int(subjects)):
grade = float(input(f"Enter the grade for subject {i + 1}: "))
total_grade += grade

average = total_grade / subjects

print("Your average grade is:", average)

شرح الكود:

الخطوة 1: استقبال إدخال المستخدم
نستخدم
input()
لاستقبال عدد المواد من المستخدم ونستخدم
float()
لضمان تحويله إلى عدد عشري.

الخطوة 2: إعداد متغير لحفظ المجموع الإجمالي للعلامات
نقوم بإعداد متغير total_grade لحفظ مجموع العلامات ونبدأه بالقيمة صفر.

الخطوة 3: جلب العلامات وحساب المجموع
نستخدم حلقة for لجلب العلامات ونضيف كل علامة إلى المجموع total_grade

الخطوة 4: حساب المعدل
نقوم بحساب المعدل بقسمة المجموع total_grade على عدد المواد num_subjects.

الخطوة 5: عرض المعدل
نقوم بعرض المعدل النهائي باستخدام
print() .


www.tgoop.com/t3lampython
👍1



tgoop.com/t3lampython/81
Create:
Last Update:

#الدرس الثالث
3.4
*شرح float مع دالة input * مثال لحساب معدل الطلاب :

حساب معدل الطلاب
#code
# الكود باللغة الإنجليزية

subjects = float(input("Enter the number of subjects: "))
total_grade = 0.0

for i in range(int(subjects)):
grade = float(input(f"Enter the grade for subject {i + 1}: "))
total_grade += grade

average = total_grade / subjects

print("Your average grade is:", average)

شرح الكود:

الخطوة 1: استقبال إدخال المستخدم
نستخدم
input()
لاستقبال عدد المواد من المستخدم ونستخدم
float()
لضمان تحويله إلى عدد عشري.

الخطوة 2: إعداد متغير لحفظ المجموع الإجمالي للعلامات
نقوم بإعداد متغير total_grade لحفظ مجموع العلامات ونبدأه بالقيمة صفر.

الخطوة 3: جلب العلامات وحساب المجموع
نستخدم حلقة for لجلب العلامات ونضيف كل علامة إلى المجموع total_grade

الخطوة 4: حساب المعدل
نقوم بحساب المعدل بقسمة المجموع total_grade على عدد المواد num_subjects.

الخطوة 5: عرض المعدل
نقوم بعرض المعدل النهائي باستخدام
print() .


www.tgoop.com/t3lampython

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




Share with your friend now:
tgoop.com/t3lampython/81

View MORE
Open in Telegram


Telegram News

Date: |

Telegram offers a powerful toolset that allows businesses to create and manage channels, groups, and bots to broadcast messages, engage in conversations, and offer reliable customer support via bots. The visual aspect of channels is very critical. In fact, design is the first thing that a potential subscriber pays attention to, even though unconsciously. How to create a business channel on Telegram? (Tutorial) Among the requests, the Brazilian electoral Court wanted to know if they could obtain data on the origins of malicious content posted on the platform. According to the TSE, this would enable the authorities to track false content and identify the user responsible for publishing it in the first place. Some Telegram Channels content management tips
from us


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