الدرس 5 - القوائم List في البايثون

Поделиться
HTML-код
  • Опубликовано: 24 янв 2025

Комментарии • 64

  • @يوسفبيبر-ن7ج
    @يوسفبيبر-ن7ج 2 года назад +1

    اسال الله تعالى ان يحفظ ويرعاك ويبعد عنك كل سوء ويرزقنا واياك الجنة

  • @sarwathamdy
    @sarwathamdy 2 года назад +2

    شكرا اخى المنذر على علمك النافع و الجميل.

  • @ShPutu
    @ShPutu 24 дня назад

    شرحك مره حيلو ومفهوم❤❤❤❤ شكرا

  • @Moustapha_Khelfaoui
    @Moustapha_Khelfaoui 11 месяцев назад

    تم حل التمرين.. شكرا جزيلا ❤

  • @amrkasoaa4511
    @amrkasoaa4511 2 года назад +2

    يعطيك ألف عافية أستاذ، وهي الكود كما يلي:
    offersname = input("Write the name of providers (separate each name with a comma): ")
    offerscost = input("Write the cost of offers (separate each name with a comma): ")
    offersnamelist = offersname.split(",")
    offerscostlist = offerscost.split(",")
    if len(offersnamelist) != 5 and len(offerscostlist) != 5:
    print("The number of Providers and number of offers costs must equal 5")
    elif len(offersnamelist) == 5 and len(offerscostlist) != 5:
    print("The number of offers costs must equal 5")
    elif len(offersnamelist) != 5 and len(offerscostlist) == 5:
    print("The number of Providers must equal 5")
    else:
    offer1rate = float(input(f"Write the rate of {offersnamelist[0]}'s bid, with cost {offerscostlist[0]}: "))
    offer2rate = float(input(f"Write the rate of {offersnamelist[1]}'s bid, with cost {offerscostlist[1]}: "))
    offer3rate = float(input(f"Write the rate of {offersnamelist[2]}'s bid, with cost {offerscostlist[2]}: "))
    offer4rate = float(input(f"Write the rate of {offersnamelist[3]}'s bid, with cost {offerscostlist[3]}: "))
    offer5rate = float(input(f"Write the rate of {offersnamelist[4]}'s bid, with cost {offerscostlist[4]}: "))
    acceptedoffers = int(0)
    acceptedofferslist =[]
    ratelist = []
    if offer1rate >= 5:
    offer1degree = int(1)
    acceptedofferslist.append(offer1rate)
    ratelist.append(offer1rate)
    else:
    offer1degree = int(0)
    if offer2rate >= 5:
    offer2degree = int(1)
    acceptedofferslist.append(offer2rate)
    ratelist.append(offer2rate)
    else:
    offer2degree = int(0)
    if offer3rate >= 5:
    offer3degree = int(1)
    acceptedofferslist.append(offer3rate)
    ratelist.append(offer3rate)
    else:
    offer3degree = int(0)
    if offer4rate >= 5:
    offer4degree = int(1)
    acceptedofferslist.append(offer4rate)
    ratelist.append(offer4rate)
    else:
    offer4degree = int(0)
    if offer5rate >= 5:
    offer5degree = int(1)
    acceptedofferslist.append(offer5rate)
    ratelist.append(offer5rate)
    else:
    offer5degree = int(0)
    acceptedoffers = offer1degree + offer2degree + offer3degree + offer4degree + offer5degree
    print(f"=*=*=*=*=*=*=*=*=*=*=*=*")
    print(f"Number of offered bids: 5")
    print(f"Number of accepted offers: {acceptedoffers}")
    if acceptedoffers != 0:
    a = min(acceptedofferslist)
    i = ratelist.index(a)
    print(f"The winner offer is: {offersnamelist[ratelist.index(min(acceptedofferslist))]}, with cost {offerscostlist[ratelist.index(min(acceptedofferslist))]}, and its rate is {min(acceptedofferslist)}")
    else:
    print(f"None of the offers are accepted")

  • @Matawfik
    @Matawfik 4 месяца назад

    جزاكم الله خيراً , شرح ممتاز

  • @amrouhussein8303
    @amrouhussein8303 Год назад

    شرح ممتاز جزاكم الله خيرا

  • @abdulkhaleqalmarhoon9690
    @abdulkhaleqalmarhoon9690 2 года назад +3

    شكرا استاذنا القدير .. اظن ان التمارين صعبة نوعا ما للمبتدئين

  • @mohamedaboabdullah2182
    @mohamedaboabdullah2182 Год назад

    مشكور استاذنا الكبير المنذر ❤

  • @سهانعمه
    @سهانعمه Месяц назад

    احسنت يا استاذ

  • @hmdelreyah
    @hmdelreyah 2 года назад

    بارك الله فيك استاذ المنذز

  • @MohammedZedan-ns5pj
    @MohammedZedan-ns5pj Месяц назад

    احلي شخص في البرمجه

    • @Modar8
      @Modar8 Месяц назад

      هل انت جديد في البرمجة صديقي ؟

    • @Modar8
      @Modar8 Месяц назад

      هل انت جديد في البرمجة

  • @musbheen
    @musbheen 2 года назад

    بارك الله فيك ، جهد عظيم تشكر عليه

  • @mohammedbenlamkadam5113
    @mohammedbenlamkadam5113 2 года назад

    شرحك رائع شكرا جزيلا

  • @tahsineido2040
    @tahsineido2040 2 года назад

    بارك الله فيك استاذ

  • @ismaildjennane8013
    @ismaildjennane8013 2 года назад

    جزاكم الله خيرا

  • @slom4444
    @slom4444 2 года назад

    اقتراح لتسهيل الشرح في الدقيقة 06:17
    هو يستدعي ابتداء من القيمة اليسرى (0) والعدد الذي يستدعيه هي القيمة اليمنى (2)

  • @muntazirsaad1603
    @muntazirsaad1603 2 года назад

    رائع وفقك الله ❤️

  • @esamnada
    @esamnada 2 года назад

    ألف شكر يا غالي

  • @mohamadbahaa2412
    @mohamadbahaa2412 2 года назад

    رااائع بارك الله فيك

  • @marwaqurany8017
    @marwaqurany8017 Год назад

    انا خلصت مذاكره البايثون لكن رجعتلها بسب تمارين حضرتك ..ياريت تعمم هذه الطريقة بالتطبيق في اي شيء يدرس

  • @one-gamer-q3t
    @one-gamer-q3t 9 месяцев назад +1

    my_list = [1, 2, 3, 4]
    print("Popped element:", my_list.pop())
    print("List after pop():", my_list)

  • @walidgaradah348
    @walidgaradah348 2 года назад +3

    Training Code as below:
    Name = input("Write the names of providers (Separate each name with a comma): ")
    Cost = input("Write the cost of offers (Separate each amount with a comma): ")
    #Rates: Type[float] = list
    Rates = []
    Accepted = []
    Providers = Name.split(",")
    Offers = Cost.split(",")
    if len(Offers) != 5:
    print("You should Write Five Amounts of offers ")
    else:
    I = 0
    Rate1 = float(input(f"Write the rate of {Providers[I]}'s bid, with cost {Offers[I]} : "))
    Rates.append(Rate1)
    if Rate1 < 5:
    pass
    else:
    Accepted.append(Rate1)
    print(Rates)
    I = I + 1
    Rate2 = float(input(f"Write the rate of {Providers[I]}'s bid, with cost {Offers[I]} : "))
    Rates.append(Rate2)
    if Rate2 < 5:
    pass
    else:
    Accepted.append(Rate2)
    print(Rates)
    I = I + 1
    Rate3 = float(input(f"Write the rate of {Providers[I]}'s bid, with cost {Offers[I]} : "))
    Rates.append(Rate3)
    if Rate3 < 5:
    pass
    else:
    Accepted.append(Rate3)
    print(Rates)
    I = I + 1
    Rate4 = float(input(f"Write the rate of {Providers[I]}'s bid, with cost {Offers[I]} : "))
    Rates.insert(I, Rate4)
    if Rate4 < 5:
    pass
    else:
    Accepted.append(Rate4)
    print(Rates)
    I = I + 1
    Rate5 = float(input(f"Write the rate of {Providers[I]}'s bid, with cost {Offers[I]} : "))
    if Rate5 < 5:
    pass
    else:
    Accepted.append(Rate5)
    print(Rates)
    print("=============================")
    print("Number of offers bids:", len(Offers))
    print("Number of offers Accepted:", len(Accepted))
    print(Accepted)
    W = min(Accepted)
    ind = Rates.index(W)
    print(f"The winner offer is: {Providers[ind]}, with cost {Offers[ind]}, and its rate is {W} ")

  • @AhoodOmar
    @AhoodOmar Год назад

    ممكن حل تمارين على ال list

  • @ليناأمعبدو
    @ليناأمعبدو 2 года назад

    حياك الله نزلنا الفيديوهات

  • @kareemaltaweel1271
    @kareemaltaweel1271 2 года назад +1

    وفقك الله استأذنا الغالي كل درس عم تزيد المتعة اكثر واكثر
    عذرا على التأخير
    #inputs
    print("hello world")
    print("This is the Tender Analysis Program")
    print("-------------------------------------------------")
    providers=input('write the name of providers (separate each name with a comma))').split(",")
    costs= input('write the cost offers (separate each offer with acomma))').split(",")
    if len(costs)!= 5 or len(providers)!=5:
    print('please insert 5 offers ')
    exit()
    rate=[ float( input(f"write the rate of {providers[0]}'s bid, with cost {costs[0]} : "))]
    rate.append(float(input(f"write the rate of {providers[1]}'s bid, with cost {costs[1]} : ")))
    rate.append(float(input(f"write the rate of {providers[2]}'s bid, with cost {costs[2]} : ")))
    rate.append(float(input(f"write the rate of {providers[3]}'s bid, with cost {costs[3]} : ")))
    rate.append(float(input(f"write the rate of {providers[4]}'s bid, with cost {costs[4]} : ")))
    #result_lists
    accept_p=[]
    accept_c=[]
    accept_r=[]
    #funtions
    n=0
    if int(rate[n]) > 5:
    accept_r.append(rate[n])
    accept_p.append(providers[n])
    accept_c.append(costs[n])
    n=n+1
    if rate[n]> 5:
    accept_r.append(rate[n])
    accept_p.append(providers[n])
    accept_c.append(costs[n])
    n=n+1
    if rate[n] > 5 :
    accept_r.append(rate[n])
    accept_p.append(providers[n])
    accept_c.append(costs[n])
    n=n+1
    if rate[n] > 5:
    accept_r.append(rate[n])
    accept_p.append(providers[n])
    accept_c.append(costs[n])
    n=n+1
    if int(rate[n]) > 5:
    accept_r.append(rate[n])
    accept_p.append(providers[n])
    accept_c.append(costs[n])
    all_offers = len(rate)
    good_offers = len(accept_r)
    win_offer_index= accept_c.index(min(accept_c))
    #result
    print("=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*")
    print(f"numbers of offerd bids : {all_offers}")
    print(f"numbers of accepted bids : {good_offers}
    ")
    print(f"the winner offer is : {accept_p[win_offer_index]} with cost {min(accept_c)} and its rate {accept_r[win_offer_index]} ")

  • @tornadosy5253
    @tornadosy5253 2 года назад

    استاذ منذر هلا اصبح الانتساب شرط لمشاهدة الكورس!؟

  • @احمدسعيدالجاسر
    @احمدسعيدالجاسر 2 года назад

    كيف يتم الانتساب لقناة

  • @Seawhite-6027
    @Seawhite-6027 2 года назад

    ممكن اتنزل التمارين واي شيء تبرمجة pdf ارجوك نتعب بالكتابة

  • @ammarshaker4214
    @ammarshaker4214 2 года назад

    بارك الله بجهودك لكن الفديوهات الاخيره لايمكن مشاهدتها مع العلم انا من المشتركين في قناتكم . ماهو الحل استاذ؟

  • @ايوبعادل-ع6ن
    @ايوبعادل-ع6ن 2 года назад

    لماذا عندما ا قوم بدمج القائمتين بهذه الطريقة يبعتلي ال error console

  • @esamnada
    @esamnada 2 года назад

    سؤال لو سمحت استاذ منذر
    بأى دالة ممكن افحص قيم داخل القوائم كى اعرف إن كانت أكبر أو أصغر من المعامل المطلوب

    • @malek_10
      @malek_10 2 года назад +2

      list = [1,2,3,5]
      a = input("enter number")
      for i in list:
      if list[i] > a:
      print("thanks")
      هذه هي الطريقة

    • @esamnada
      @esamnada 2 года назад

      @@malek_10 ألف شكر اخي الغالي كانا لم نأخذ تعليمة for ولكن الحمدلله فهمتها في درس القاموس ألف شكر على اهتمامك واتشرف بردك الجميل واكون من متابعيك ألف شكر اخي الغالي

    • @malek_10
      @malek_10 2 года назад +1

      @@esamnada عفوا

  • @hayan81
    @hayan81 2 года назад

    ولكن ظالة sort لم تظهر عندي

  • @mingosutu
    @mingosutu 5 месяцев назад

    شكرا معليييييييم. يا أستاذة البرمجة تعالو تعلموا طريقة التدريس. كل فيديو متخص بجزء فقط. مش كل البرامج في فيديوا واحد!

  • @masterboxxx
    @masterboxxx 2 года назад

    استاذنا الكريم ،، هل الانتساب ب50$ للجلسات متاح حاليا ،، مع الشكر

  • @Fhshsdakre
    @Fhshsdakre 2 года назад

    ❤️

  • @jafaralturfy5053
    @jafaralturfy5053 2 года назад

    حل التمرين
    rates_List = []
    accepted_offers = []
    accepted_offers_number = 0
    count = 0
    providers_names = input("Write the names of the providers (Separate each name with a space and choose 5 only): ")
    costs = input("Write the costs of the offers (Separate each cost with a space): ")
    providers_list = providers_names.split()
    costs_list = costs.split()
    if len(providers_list) > 5 or len(costs_list) > 5:
    print("Please choose 5 offers only.")
    exit()
    print("
    ")
    print("Rate the offers (Highest rate for the lowest cost):
    ")
    while count < 5:
    rate = input(f"Write the rate of {providers_list[count]}'s, with cost {costs_list[count]}: ")
    rates_List.insert(count, rate)
    count = count + 1
    for i in rates_List:
    if float(i)

  • @ليناأمعبدو
    @ليناأمعبدو 2 года назад

    بدي انتساب و مافي حساب
    عندك وكيل بادلب ؟

  • @mohamedsalah-lv7vl
    @mohamedsalah-lv7vl 2 года назад

    +REP

  • @ABO7ALAB
    @ABO7ALAB 2 года назад

    مابعرف شو فائدة انه نكتب الحل بالتعليقات اذا مافي اي تفاعل منك ولاحتى يمكن تشوف التعليقات حتى يحس المتابع انه عمل شي مفيد يعني مثلا ممكن نحلها ونخليها عندنا حتى المقطع القادم ونشوف الحل !

  • @Zahra_Hashim1
    @Zahra_Hashim1 2 года назад

    ❤️🫡

  • @tariqmoheidat7227
    @tariqmoheidat7227 2 года назад

    after alot of working >>> I did another solution for this practice >>> still feeling my self a genius
    providers =[]
    cost = []
    evaluation = []
    count = int(input("how many providers you want to process ? "))
    x=1
    for x in range(count):
    v=input("please enter the first provider: ").title()
    n = float(input("please enter the first cost for " + v + ": "))
    eva1 = float(input(f"please enter your evaluation for {v} with cost {n} : "))
    providers.append(v)
    cost.append(n)
    if eva1 < 5:
    providers.remove(v)
    cost.remove(n)
    else:
    evaluation.append(eva1)
    x = +1
    print("the count of offers is " + str(count) + " and had been chosen " + str(len(providers)))
    the_winner = min(cost) #تعطي قيمة رقمية للقيمة الأقل في القائمة
    place_of_min_coast = cost.index(the_winner) #تعطي مكان القيمة الأقل في قائمة coasts
    place_of_min_coast1 = providers[place_of_min_coast] #تعطي قيمة المقابلة للقيمة الأقل في قائمة المزودين
    place_of_rate = evaluation[place_of_min_coast]
    print(providers)
    print(cost)
    print(evaluation)
    print("====================================================================")
    the_last_print = (f"the best offer you can approve it is {place_of_min_coast1} with coast {the_winner} his rate is {place_of_rate}").title()
    print(the_last_print)
    print("====================================================================")

  • @abdallah.kandiel
    @abdallah.kandiel 2 года назад

    حل التمرين
    a =input("Write the names of Providers separated by commas : ")
    providers= a.split(',')
    b = input("Write the cost of the offers separated by commas : ")
    offers = b.split(",")
    if len(providers) != 5 or len(offers) != 5 :
    print("you have to enter exact 5 providers & 5 Offers ")
    exit()
    selected_Providers=[]
    selected_offers=[]
    selected_rates =[]
    ''''''''''''''''''''''''
    r0 = int(input(f"input the Rate of {providers[0]} with cost {offers[0]} : "))
    if r0 >= 5:
    selected_Providers.append(providers[0])
    selected_offers.append(offers[0])
    selected_rates.append(r0)
    r1 = int(input(f"input the Rate of {providers[1]} with cost {offers[1]} : "))
    if r1 >= 5:
    selected_Providers.append(providers[1])
    selected_offers.append(offers[1])
    selected_rates.append(r1)
    r2 = int(input(f"input the Rate of {providers[2]} with cost {offers[2]} : "))
    if r2 >= 5:
    selected_Providers.append(providers[2])
    selected_offers.append(offers[2])
    selected_rates.append(r2)
    r3 = int(input(f"input the Rate of {providers[3]} with cost {offers[3]} : "))
    if r3 >= 5:
    selected_Providers.append(providers[3])
    selected_offers.append(offers[3])
    selected_rates.append(r3)
    r4 = int(input(f"input the Rate of {providers[4]} with cost {offers[4]} : "))
    if r4 >= 5:
    selected_Providers.append(providers[4])
    selected_offers.append(offers[4])
    selected_rates.append(r4)
    ''''''''''''''''''''''''
    #mm= (max(selected_offers))
    m= selected_offers.index((max(selected_offers)))
    if len(selected_Providers)< 3 :
    print(f'''f' selected offers is less than 3 , however
    the winner in such case is
    {selected_Providers[m] } with cost {selected_offers[m]} and rate {selected_rates[m]}
    '
    ''' )
    else:
    print(f''' a total sum of 5 offers were examined ,
    {len(selected_offers)} of them were accepted
    the winner is
    {selected_Providers[m]} with cost {selected_offers[m]} and rate {selected_rates[m]}
    '
    ''')

  • @mamdouhyoussef1696
    @mamdouhyoussef1696 2 года назад

    from array import *
    Names = str(input("Write the names of providers (Separate each name with a comma): ")).split(',')
    Costs = input("Write the cost of offers (Separate each amount with a comma): ").split(',')
    Accepted_Names = []
    RateList = []
    Accepted_Cost = []
    if len(Names) and len(Costs) != 5:
    print("it is wrong")
    exit()
    # RateList = rate1 + rate2 + rate3 + rate4 + rate5
    i = 0
    rate1 =input(f"Write the rate {Names[i]}'s bid, with cost {Costs[i]}: ")
    if rate1 >= "5":
    RateList.append(rate1)
    Accepted_Names.append(Names[i])
    Accepted_Cost.append(Costs[i])
    i = i + 1
    rate2 =input(f"Write the rate {Names[i]}'s bid, with cost {Costs[i]}: ")
    if rate2 >= "5":
    RateList.append(rate2)
    Accepted_Names.append(Names[i])
    Accepted_Cost.append(Costs[i])
    i = i + 1
    rate3 =input(f"Write the rate {Names[i]}'s bid, with cost {Costs[i]}: ")
    if rate3 >= "5":
    RateList.append(rate3)
    Accepted_Names.append(Names[i])
    Accepted_Cost.append(Costs[i])
    i = i + 1
    rate4 =input(f"Write the rate {Names[i]}'s bid, with cost {Costs[i]}: ")
    if rate4 >= "5":
    RateList.append(rate4)
    Accepted_Names.append(Names[i])
    Accepted_Cost.append(Costs[i])
    i = i + 1
    rate5 =input(f"Write the rate {Names[i]}'s bid, with cost {Costs[i]}: ")
    if rate5 >= "5":
    RateList.append(rate5)
    Accepted_Names.append(Names[i])
    Accepted_Cost.append(Costs[i])
    w = min(Accepted_Cost)
    p = Accepted_Cost.index(w)
    print(f"Number of offered: {len(Names)}")
    print(f"Number of accepted {len(Accepted_Names)}")
    #print(f"cost is: {w} ")
    print(f"The winner is:{Accepted_Names[p]}, with cost {Accepted_Cost[p]}, and its rate is {RateList[p]} ")

  • @abdallah.kandiel
    @abdallah.kandiel 2 года назад

    حل آخر باستخدام for
    a =input("Write the names of Providers separated by commas : ")
    providers= a.split(',')
    b = input("Write the cost of the offers separated by commas : ")
    offers = b.split(",")
    if len(providers) != 5 or len(offers) != 5 :
    print("you have to enter exact 5 providers & 5 Offers ")
    exit()
    selected_Providers=[]
    selected_offers=[]
    selected_rates =[]
    ''''''''''''''''''''''''
    for i in range( 0,4 ):
    r = int(input(f"input the Rate of {providers[i]} with cost {offers[i]} : "))
    if r(i) >= 5:
    selected_Providers.append(providers[i])
    selected_offers.append(offers[i])
    selected_rates.append(i)
    next(i)
    ''''''''''''''''''''''''
    #mm= (max(selected_offers))
    m= selected_offers.index((max(selected_offers)))
    if len(selected_Providers)< 3 :
    print(f'''f' selected offers is less than 3 , however
    the winner in such case is
    {selected_Providers[m] } with cost {selected_offers[m]} and rate {selected_rates[m]}
    '
    ''' )
    else:
    print(f''' a total sum of 5 offers were examined ,
    {len(selected_offers)} of them were accepted
    the winner is
    {selected_Providers[m]} with cost {selected_offers[m]} and rate {selected_rates[m]}

  • @Moustapha_Khelfaoui
    @Moustapha_Khelfaoui 11 месяцев назад

    معلومات قيمة.. شكرا جزيلا..❤

  • @notamine234
    @notamine234 10 месяцев назад

    جزاكم الله خيرا