مشاركة حلول: معالجة العديد من طلبات التقديم scholarships

معالجة العديد من الطلبات مع العمل الاضافي

def apply():
    age = int(input())
    
    # to make conditions more flixable
    def conditions():
        if  age <  18 :
            #some explainations
            print('your age is: ',age,' so You are too young for this scholarship ')
    
        elif  age <= 22 :
            print('your age is: ',age,'Great..,  Welcome To Yemen scholarship Program !')
        else: #any Age that bigger than 22 is not allowed !! so.. 

            print('your age is: ',age,' so You are too old for this scholarship')
   
    conditions()
#loop for shorting the code     
count = 0 
while count < 1000:
    apply()
    count = count + 1   



1 Like

عمل رائع :+1:

لا داعي لعمل دالة داخل دالة لانها تقوم بالمطلوب لوحدها

def apply():
age = input(“Enter your age:”)
age = int(age)
if age < 18:
print(“You are too young”)
elif age <= 22:
print(“Welcome to Jordan scholarship program”)
else:
print(“You are too old”)

apply()
apply()
apply()
apply()
apply()

for i in range(0,5):
apply()

for i in range(0,1000):
apply()

1 Like
def apply():
    age = input(" enter you age please")
    age = int(age)
    if  age < 18:
        print("You are too young")
    elif age > 22:
        print("You are too old")
    else:
        print("Welcome to Egypt scholarship program")
        
apply()
apply()
apply()
apply()
apply()


def apply():
    age = input(" enter you age please")
    age = int(age)
    if  age < 18:
        print("You are too young")
    elif age > 22:
        print("You are too old")
    else:
        print("Welcome to Egypt scholarship program")
x = 1       
while x < 1000:
    apply()
    x = x + 1

1 Like

لو ممكن تقوم بتنسيق الأكواد كما موضح في الفيديو هنا لنستطيع قرائتها

عمل ممتاز يا احمد :+1:

هذا هو الحل الخاص بي

def apply():
    age = input("your age:" )
    age =int(age)
    if age < 18:
        print("You are too young")
    elif age > 22:
        print("You are too old")
    else :
        print("Welcome to Egypt scholarship program")

for i in range(0,1000):
    apply()
1 Like

عمل رائع يا كمال :+1:

1 Like

شكرا استاذ ياسر ^^

1 Like

لو سمحت كيف تم التعرف على i ؟؟

,
age = input(“your age:” )
age =int(age)
,
@YaserAlnajjar
لو سمحت ما فهمت هاد الكود، وحتى عم يعتبرلي ياه خطأ بالبرنامج، ممكن شرح اكتر؟؟

2 Likes

مرحبا @Wael.mansour :blush:

age=input("your age")

يعني قم بإدخال عمرك

age=int(age)

هذا الكود يقوم بتغيير العمر إلى int نستعمله لتأكيد أن العمر عدد

ألاحظ أن double quote عندك فيها خطأ

3 Likes

@Wael.mansour
لكتابة الأكواد بطريقة صحيحة

2 Likes

شكراً جزيلاً لكِ

2 Likes

Your welcome :blush: @Wael.mansour

2 Likes
def apply():
    age = input("inter your age")
    age =int(age)
    if age <18:
        print("you are too young")
    elif age >23:
        print("you are too old")
    else:
        print("Welcome to Egypt scholarship program")
count = 1000
while count>0:
   apply()
   count-=1


2 Likes

عمل جيد يا اسراء :+1:
انتقلي للمهام التالية

1 Like

Code (With the bonus)

def apply():
    age = int(input("Please enter your age: "))
    if(age < 18):
        print("You are too young")
    elif(age > 22):
        print("You are too old")
    else:
        print("Welcome to Egypt scholarship program")
     
applyCount = int(input("Please enter the number of candidates: "))
while(applyCount > 0):
    apply()
    applyCount -= 1

ولكن في البداية يطلب عدد المتقدمين للمنحة :sweat_smile:

1 Like

شكراً أخي مرة ثانية :blush: :relaxed:

1 Like