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

حل جميل و نظيف ممتاز @Kareem

ملاحظة في ال while loop يمكنك جعل الكاونتر يتناقص و الاستغناء عن تعريف متغير ثان i

3 Likes

أصلحنا المشكلة… شكراً صديقي عبد الكريم على التنبية :+1:

1 Like
def apply():
    age = int(age)
    
    if age < 18 and age > 0:
        print("you are too young")
    elif age <= 22 and age > 0:
        print("welcome to egypt schoolship program")
    elif age >= 23:
        print("you are to old")
    else:
        print("error: try to put a number ex:1,2,3,4.........")


apply()
apply()
apply()
apply()
apply()
2 Likes
def apply():
   age = int(age)
    
    if age < 18 and age > 0:
        print("you are too young")
    elif age <= 22 and age > 0:
        print("welcome to egypt schoolship program")
    elif age >= 23:
        print("you are to old")
    else:
        print("error: try to put a number ex:1,2,3,4.........")


count = 0
while count <1000:
    apply()
    count = count + 1
2 Likes

عمل رائع @AbdulMalik :+1:

2 Likes

استاذ لماذا لا يظهر لي الأكواد التي خزنتها بواسطة Github على بيئة العمل

2 Likes

هل بإمكانك التوضيح كيف قمت بتخزين الأكواد ؟

بيئة العمل لا تحتفظ بالأكواد لفترة طويلة :smile:

2 Likes
def apply():
    age = input()
    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')
        
count = 0
while count < 1000:
    apply()
    count +=1

فيه مشكلة طبعا بالمسافات

2 Likes

حللت المشكلة بتعديل الأكواد وإضافتها إلى بلوك…

عمل رائع :+1:

1 Like
def apply():
    age=int(input())
  
    if age < 18:
        print('You are too young')
    elif age >22:
        print('You are too old')
    else:
        print('Welcome to Egypt scholarship program')
      
x=0
while x<1000:
    apply()
    x+=1
2 Likes

عمل رائع يا نادر :+1:

2 Likes
def apply():
    age = input()
    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')
   
# المهمة الإضافية     
count = 0
while count < 1000:
    apply()
    count = count + 1

هل سارت الأمور بشكل جيد؟ :roll_eyes: :roll_eyes:

2 Likes

نعم على أفضل حال سارت :smile: :+1:

2 Likes
def apply ():
    age = input ("enter your age")
    age = int (age)

    print (age) 

    if age <18 :
         print ("You are too young")
    elif 18 <= age <= 22 :
         print ("Welcome to Egypt scholarship program")
    else:
         print ("You are too old")  

         
count=1
while count <=5:
    apply ()
    count=count+1
3 Likes

عمل رائع يا @Alaa-Sh2018 :+1:

1 Like

معالجة طلبات التقديم + المهمة الاضافية

def apply():
    try:
        age = input("Enter 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")
    except ValueError:
        print("this is not a nomber")
        apply()

applicants = input("No. of applicants = ")
applicants = int(applicants)
for i in range(applicants):
    apply()
2 Likes
def apply():
    age = int(input("Enter your age:"))
    if age == 15:
        print("You are too young")
    elif age == 20:
        print("Welcome to Jordan scholarship program")
    elif age == 25 :
        print("You are too old")
for i in range(5):
    apply()
1 Like
def apply():
    age = int(input("Enter your age:"))
    if age == 15:
        print("You are too young")
    elif age == 20:
        print("Welcome to Jordan scholarship program")
    elif age == 25 :
        print("You are too old")
for i in range(100):
    apply()
1 Like

عمل رائع نجوين… انتقلي للتالي :+1:

5 المشاركات التي انقسمت الي موضوع جديد: %{topic_link]