stringYes we Can printstring4 printlenstring printstring3 printstring 2
- Slides: 88
שאלות ממבחנים string="Yes we Can!!!" משתנים : בהתאם לטבלה , יש להציג את הפלט. לפניך מחרוזת הוראה print(string[4]) print(len(string)) print(string[-3]) print(string[: : 2]) print(string[4: -3]) print(string[: ]) 6 פלט
שאלות ממבחנים משתנים . No או Yes אשר יתנו את התוצאה , num 2 ו num 1 קלטים עבור 2 עליכם לרשום num 1 = int(input(“Enter the first number)) num 2 = int(input(Enter the second number)) if num 1 > 5 and num 2 <= 4: print (”Yes”) else: print (“No”) 7
שאלות ממבחנים משתנים . No או Yes אשר יתנו את התוצאה , num 2 ו num 1 קלטים עבור 2 עליכם לרשום num 1 = int(input(“Enter the first number)) num 2 = int(input(Enter the second number)) if num 1 > 5 or num 2 <= 4: print (”Yes”) else: print (“No”) 8
שאלות ממבחנים משתנים : יש להציג את הפלט. לפניך קטע קוד num 1 = int(input(“Enter the first number)) num 2 = int(input(Enter the second number)) if (num 1 > 5 or num 2 <= 4) and num 1==num 2: print (”Yes”) else: print (“No”) 9
שאלות ממבחנים משתנים : יש להציג את הפלט. לפניך קטע קוד num 1 = int(input(“Enter the first number)) num 2 = int(input(Enter the second number)) if num 1 > 5 or (num 2 <= 4 and num 1==num 2): print (”Yes”) else: print (“No”) 10
שאלות ממבחנים ? • מהו הפלט המתקבל number=123 print (number //100) print (number //10 % 10) print (number % 10 15
שאלות ממבחנים ? • מהו הפלט המתקבל number =12345 print (number // 100) print (number % 100) 16
שאלות ממבחנים ? • מהו הפלט המתקבל number = 123 while number>0: print(number%10) number=int(number//10) 17
שאלות ממבחנים turtle לפניך קטע קוד אשר עושה שימוש בספריית . איזה מבין הפלטים שלפניך יוצג על–גבי מסך המחשב? סמן בעיגול את התשובה הנכונה. קטע הקוד הורץ import turtle tw = turtle. Screen() player = turtle. Turtle() player. shape('square') size = 100 player. pendown() for index in range(4): for item in range(4): player. forward(size) player. left(90) size = size-20 turtle. mainloop() 22
שאלה מסכמת מבוא לפיבונצ'י first = 5 second = 7 temp = 0 temp = first = second = temp print("first= ", first) print("second= ", second) 28
המשך תרגול . קטע הקוד הורץ. turtle לפניך קטע קוד אשר עושה שימוש בספריית ? מהו הפלט שיוצג import turtle tw = turtle. Screen()player = turtle. Turtle()player. shape('square') def pologon(n): player. clear() for i in range(n): player. pd() player. color("blue") player. fd(50) player. rt(360/n) pologon(6)turtle. mainloop() 32
משימות מסכמות ? מה יהיה פלט התכנית import turtle tw = turtle. Screen() player = turtle. Turtle() player. shape("square") size = 100 player. pendown() for index in range(4): for item in range(4): player. forward(size) player. left(90) size = size - 20 turtle. mainloop() 40
משימות מסכמות ? מה יהיה פלט התכנית import turtle tw = turtle. Screen() player = turtle. Turtle() player. shape("square") size = 100 player. pendown() for index in range(4): for item in range(4): player. forward(size) player. left(90) size = size - 20 turtle. mainloop() 41
גרפיקת פייתון import turtle def do_it(x, y): global click_num global size player. penup() player. goto(x, y) player. shapesize(size) if click_num % 2 == 0: player. color("blue") else: player. color("red") player. stamp() click_num = click_num + 1 size = size + 1 44 tw = turtle. Screen() click_num = 0 size = 2 tw. onclick(do_it) player = turtle. Turtle() player. shape("square") turtle. mainloop()
שאלה מסכמת מבוא לפיבונצ'י first = 5 second = 7 temp = 0 temp = first = second = temp print("first= ", first) print("second= ", second) 51
לולאות עם מונה וצובר donation = 0 sumd = 0 ans = "y" תרומות while(ans=="y"): donation = int(input("What is your donation: ")) sumd=sumd+donation print("Thank you for your contribution") ans=input("Do you wish to continue? y/n") print("Total: ", sumd)
לולאות עם מונה וצובר הפלט - תרומות What is your donation: 100 Thank you for your contribution Do you wish to continue? y/n y What is your donation: 600 Thank you for your contribution Do you wish to continue? y/n y What is your donation: 800 Thank you for your contribution Do you wish to continue? y/n n Total: 1500 57
לולאות עם מונה וצובר משחק הניחושים import random sod=random. randint(1, 9) for i in range(3): ans=int(input("Enter number: ")) if(sod==ans): print("You Won") else: print("Try again") 58
לולאות עם מונה וצובר שטח איחסון volume=4000 ans=0 while(ans>-1): ans=int(input("Enter file size: ")) volume=volume-ans print(volume+ans) 60
לולאות עם מונה וצובר מציאת מינימום – המשך דוגמת הקבצים minimum=int(input("Enter file size: ")) ans=0 for i in range(9): ans=int(input("Enter file size: ")) if ans<minimum: minimum=ans print("minimum=", minimum) 61
לולאות עם מונה וצובר מציאת מקסימום – המשך דוגמת הקבצים maximum=0 ans=0 for i in range(10): ans=int(input("Enter file size: ")) if ans>maximum: maximum=ans print("maximum=", maximum) 62
לולאות עם מונה וצובר ממוצע ציונים end=0 count=0 grade=0 sum_grades=0 while(grade>-1): grade=int(input("Enter grade: ")) count=count+1 sum_grades= sum_grades + grade print("grades average: = ", (sum_grades-grade)/(count-1)) 64
לולאות עם מונה וצובר כניסה ללונה פארק – אתחול ומשתנים count_adult=0 count_kid=0 count_student=0 count_old=0 status = " " sum_all=0 67
לולאות עם מונה וצובר כניסה ללונה פארק – קלט ותנאים while(status!="end"): status=input("Enter a, k, s or o: ") if(status=="a"): count_adult=count_adult+1 if(status=="k"): count_kid=count_kid+1 if(status=="s"): count_student=count_student+1 if(status=="o"): count_old=count_old+5 68
לולאות עם מונה וצובר כניסה ללונה פארק – חישוב חכם sum_all=45*count_adult + 15*sum_all + 25*count_student+ 5*count_old 69
לולאות עם מונה וצובר פלט , כניסה ללונה פארק – הודעות למסך print("adult=", count_adult) print("kids=" , count_kid) print("student=" , count_student) print("old=" , count_old) print("total: = ", sum_all) 70
לולאות עם מונה וצובר תירגול מונים plus=0 minus=0 for i in range(20): ans=int(input("Enter number: ")) if(ans>=0): plus=plus+1 else: minus=minus+1 print("plus: ", plus, " minus: ", minus) 71
לולאות מונה צובר קלט - קבלה לעבודה imp = int(input("Years of employment: ")) study = int(input("Years of study: ")) 75
לולאות מונה צובר אתחול - קבלה לעבודה if sel<8: print("Not haired") noth=noth+1 elif sel>7 and sel<16: print(“Hired to work") work=+1 elif sel >15: print(“Hired to manger") mange=+1 76
לולאות מונה צובר מונים - קבלה לעבודה for i in range(100): imp = int(input(“Years of employment: ")) study = int(input(“Years of study: ")) sel = imp * study if sel<=7: print("Not haired") noth=noth+1 elif sel>=8 and sel<=15: print(“Hired to work") work=+1 elif sel >= 16: print(“Hired to manger") mange=+1 print(noth, work, manage) 77
לולאות מונה צובר חיבור - קבלה לעבודה for i in range(100): imp = int(input(“Years of employment: ")) study = int(input(“Years of study: ")) sel=func_sell(imp, study) if sel<8: print("Not haired") noth=noth+1 elif sel>7 and sel<16: print(“Hired to work") work=+1 elif sel >15: print(“Hired to manger") mange=+1 print(noth, work, manage) 78 noth, work, mange, sel=0 def func_sel(z, f): return z * f
לולאות עם מונה וצובר מפעל החרוזים count_red=0 count_green=0 count_yellow=0 count_ok=0 count_bad=0 bid_color = " " 82
לולאות עם מונה וצובר מונים - מפעל החרוזים num_bids=int(input("Bids number: ")) for i in range(num_bids): bid_color=input("Write bid color: ") if(bid_color=="red"): count_red=count_red+1 if(bid_color=="green"): count_green=count_green+1 if(bid_color=="yellow"): count_yellow=count_yellow+1 83
לולאות עם מונה וצובר תנאים - מפעל החרוזים count_green==count_yellow and count_green==count_red and count_red==count_yellow count_green>0 and count_yellow>0 and count_red>0 if (count_green==count_yellow and count_green==count_red and count_red==count_yellow and count_green>0 and count_yellow>0 and count_red>0): count_ok=count_ok+1 מוני שרשראות else: count_bad=count_bad+1 print("There are =", count_bad, "defective necklaces") print("We produced" , count_bad+count_ok, "necklaces ") 84
לולאות עם מונה וצובר count_red=0 count_green=0 count_yellow=0 count_ok=0 count_bad=0 bid_color = " " num_bids=int(input("Bids number: ")) for i in range(num_bids): bid_color=input("Write bid color: ") if(bid_color=="red"): count_red=count_red+1 if(bid_color=="green"): count_green=count_green+1 if(bid_color=="yellow"): count_yellow=count_yellow+1 מפעל החרוזים if (count_green==count_yellow and count_green==count_red and count_red==count_yellow and count_green>0 and count_yellow>0 and count_red>0): count_ok=count_ok+1 else: count_bad=count_bad+1 print("There are =", count_bad, "defective necklaces") print("We produced" , count_bad+count_ok, "necklaces ") 85
- If you think you can you can poem
- If you can't measure it you cannot improve it
- Arrangement of element of curriculum is known as
- Modal verbs can can't
- Look at the pictures and complete with can or can't
- Measurement quotes
- Any fool can write code that a computer can understand
- Talk en futuro
- You can tell harris about it just ____(easily) as i can
- If you can imagine it you can achieve it
- Dr jean bear hunt song
- If you can’t measure it, you can’t manage it
- Metaphor in sonnet 18
- Positive degree examples
- Kinds of comparison
- Through you nothing is impossible
- Can can body percussion
- Goldene bilanzregel
- He can speak
- Close your eyes
- What is the first activity in software project planning?
- Types of fossils
- Aquatic plants can be classified into
- Asimetrik nüfus piramidi
- Can lossy compression be reversed
- How can text be organized
- Wood made things name
- Can mal akıl nesil din
- How to calculate break even point in dollars
- Can sine rule be used on right angled triangles
- I can swim well
- Dr. jekyll and mr. hyde
- Tcc call 2000
- Solvent abuse can kill instantly meaning
- Gravity and friction lesson 1
- Weak and strong form of can
- A product can be mgt211
- Expressing ability and inability ne demek
- Short workings in royalty account
- Corpus delicti
- Which of the following transformations are rigid motions
- Why is fiber considered class evidence
- When can we use l'hopital's rule
- A satellite can fail for many possible reasons
- He can turn the tides
- Binary representation of images
- Each week mackenzie can make 10 to 25 necklaces
- Isabella peng
- Cant gradient
- Nifnif pals
- Hachure marks topographic map
- Momentum can be defined as
- Can potential energy be negative
- Tonight i can write by pablo neruda analysis
- What impact does a tornado have on an ecosystem
- What are the four factors influencing communication?
- I can't see tim's car
- Which career action can get you diamonds
- Midpoint line drawing algorithm in computer graphics
- Introduction of secretary
- Life can only be understood backward
- I'd rather take baths with a man-eating shark
- Specific purpose statement
- How can we
- 8051 addressing modes
- Rationalize the denominator
- Modifying adverbs
- Can crusher design specification
- Chúc tụng ngài là chúa tể càn khôn
- Things you can climb
- Characteristics of ajanta paintings
- Greet and introduce yourself
- Archaebacteria multicellular or unicellular
- Comparative advantage exists when one person can produce
- Permutation and combination keywords
- Common logarithm examples
- How will you avoid plagiarism
- He can turn the tides and calm the angry sea
- Production record in business
- Learning can be defined as
- Footedware
- Installing fusioncompute
- Can kimya
- Html tables
- Receptionist good morning
- Symbolism
- How a self-fulfilling stereotype can drag down performance
- Can do descriptors
- Cansen can akgül