top of page
תוצאות החיפוש
Type
Category
132 items found for ""
- מגדל האנוי - חידת פייתוןIn General Discussions6 במאי 2019פתרון רקורסיבי המכיל שלושה שלבים ושתי רקורסיות, הרעיון הוא לחלק את הבעיה לסדרה של בעיות קטנות יותר, אם למשל יש לי 3 טבעות להזיז לעמוד הימני ביותר, אני יודע שאני צריך להזין את שתי הטבעות העליונות לעמוד האמצעי, וכך אני אוכל להזיז את הטבעות האחרונה ליעד שלה, לאחר השלב הזה אני נותר עם מספר טבעות קטן באחד אבל על עמוד אחר (העמוד האמצעי ולא העמוד השמאלי) כך שהעמוד השמאלי הוא הופך להיות עמוד הביניים בדרך ליעד לכן לאחר השלב השני של הזזת הטבעת הבודדות (שזה המהלך היחיד אותו אנו רוצים להדפיס) אנו מפעילים שוב את הפונקציה המקורית רק שהפעם מהעמוד שהיה במקור עמוד הביניים ליעד: def tower(n,s,i,d):#n=מספר הטבעות s=מקור הטבעות i=עמוד מקשר d=היעד של הטבעות if n==0: pass else: tower(n-1,s,d,i) print(s,d) tower(n-1,i,s,d) tower(5,"a","b","c") #for 5 rings >>> b c #- c-ל b-הטבעת הראשונה עוברת מ a c b a c b c a b a b c a c a b c b a c b a b c a c10
- חידת הצפרדעים והקרפדותIn General Discussions20 באפריל 2019הפתרון שלי עובד עבור כל n צפרדעים ולוח של 2n+1 - במקרה הזה עבור 5 צפרדעים וחמש קרפדות המחליפות מקום. בפתרון שלי קרפדות מסומנות ב- 0, צפרדעים מסומנות ב- 1 והמקום הריק ב- 2- #Toads = 0 #Frogs = 1 #Empty Place = 2 class Frogs_and_Toads: def __init__(self, n): self.n = n self.board = [0 for i in range(n)] + [2]+ [1 for i in range(n)] self.solution = [1 for i in range(n)] + [2]+ [0 for i in range(n)] self.steps = [self.board[::]] self.solve() def pm(self, board): # bc stands for board copy - a copy of the board possible_moves = [] for place, item in enumerate(board): try: if item == 0: if board[place+1] == 2: bc = board[::] bc[place] = 2 bc[place+1] = 0 possible_moves.append(bc) if item == 1: if place != 0: if board[place-1] == 2: bc = board[::] bc[place] = 2 bc[place-1] = 1 possible_moves.append(bc) except: pass if place < len(board)-2: if item == 0 and board[place+1] == 1 and board[place+2] == 2: bc = board[::] bc[place] = 2 bc[place+2] = 0 possible_moves.append(bc) if place > 1: if item == 1 and board[place-1] == 0 and board[place-2] == 2: bc = board[::] bc[place] = 2 bc[place-2] = 1 possible_moves.append(bc) return possible_moves def solve(self): if self.solution in self.steps: for item in self.steps: print(item) exit() else: for item in self.pm(self.steps[-1]): self.steps.append(item) self.solve() self.steps.pop() Frogs_and_Toads(5) >>> [0, 0, 0, 0, 0, 2, 1, 1, 1, 1, 1] [0, 0, 0, 0, 2, 0, 1, 1, 1, 1, 1] [0, 0, 0, 0, 1, 0, 2, 1, 1, 1, 1] [0, 0, 0, 0, 1, 0, 1, 2, 1, 1, 1] [0, 0, 0, 0, 1, 2, 1, 0, 1, 1, 1] [0, 0, 0, 2, 1, 0, 1, 0, 1, 1, 1] [0, 0, 2, 0, 1, 0, 1, 0, 1, 1, 1] [0, 0, 1, 0, 2, 0, 1, 0, 1, 1, 1] [0, 0, 1, 0, 1, 0, 2, 0, 1, 1, 1] [0, 0, 1, 0, 1, 0, 1, 0, 2, 1, 1] [0, 0, 1, 0, 1, 0, 1, 0, 1, 2, 1] [0, 0, 1, 0, 1, 0, 1, 2, 1, 0, 1] [0, 0, 1, 0, 1, 2, 1, 0, 1, 0, 1] [0, 0, 1, 2, 1, 0, 1, 0, 1, 0, 1] [0, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1] [2, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1] [1, 0, 2, 0, 1, 0, 1, 0, 1, 0, 1] [1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 1] [1, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1] [1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 1] [1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2] [1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0] [1, 0, 1, 0, 1, 0, 1, 2, 1, 0, 0] [1, 0, 1, 0, 1, 2, 1, 0, 1, 0, 0] [1, 0, 1, 2, 1, 0, 1, 0, 1, 0, 0] [1, 2, 1, 0, 1, 0, 1, 0, 1, 0, 0] [1, 1, 2, 0, 1, 0, 1, 0, 1, 0, 0] [1, 1, 1, 0, 2, 0, 1, 0, 1, 0, 0] [1, 1, 1, 0, 1, 0, 2, 0, 1, 0, 0] [1, 1, 1, 0, 1, 0, 1, 0, 2, 0, 0] [1, 1, 1, 0, 1, 0, 1, 2, 0, 0, 0] [1, 1, 1, 0, 1, 2, 1, 0, 0, 0, 0] [1, 1, 1, 2, 1, 0, 1, 0, 0, 0, 0] [1, 1, 1, 1, 2, 0, 1, 0, 0, 0, 0] [1, 1, 1, 1, 1, 0, 2, 0, 0, 0, 0] [1, 1, 1, 1, 1, 2, 0, 0, 0, 0, 0] הפתרון מראה את כל התהליך של החלפת המקומות בין הצפרדעים לקרפדות. טבע ארבילי10
- חידת הצפרדעים והקרפדותIn General Discussions17 באפריל 2019טוב אם ניסיתם במשך כמה ימים ולא הצלחתם , הנה פתרון באמצעות מחלקה -class - וגם רקורסיה - וגם backtracking . לא פתרון של שתי שורות (למי שיש לו רעיון שידביק כאן בשמחה אני לא משלם לפי מספר העמודים באתר), אלא פתרון כזה שאפשר, אולי, ללמוד ממנו משהו - האסטרטגיה של- backtracking מחפשת את הפתרון הנכון מבין האופציות שיש בכל סיטואציה (במדריך יש אנלוגיה של עץ וענפים שזה סבבה), כאשר לא מוצאת בענף מסוים, משיבה את המצב לקדמותו וממשיכה לחפש (למשל אם הסתבר שלהזיז צפרדע לא נותן פתרון, אזי בסיבוב הבא, באותה סיטואציה, התוכנית תקפיץ קרפדה (לא לבעלי קיבה חלשה). תחילה מקימים מחלקה בשם Creature המתאימה לכל הייצורים האמפיביים, הן צפרדעים והן קרפדות. המחלקה כוללת את הפונקציות הבאות __init__ המספרת לנו מה יש במחלקה - type הוא attribute המטפל בסוג האמפיבי שלנו, צפרדע "f" או קרפדה "t" (באנגלית toad). בהמשך location מטפלת במיקום של הייצור בביצה שלנו שהיא רשימה בשם line (האיבר הראשון משמאל הוא [line[0 כך שהמיקום של מי שנמצא שם הוא 0). על מנת שנוכל להזיז את הייצורים יש לנו מתודות (שהן פונקציות בתוך מחלקה) כמו move , jump undo_move המותאמות לכל ייצור בנפרד. יש לנו מתודה option המתארת את אפשרות התזוזה של כל ייצור, ויש גם מתודה __repr__ כדי לייצג באופן הולם את הדרך שבה אנו רוצים לראות את הייצור כאשר נבקש להדפיס אותו למשל. class Creature: def __init__(self,type,location,line): self.type=type self.location=location self.line=line def move(self): self.last_location=self.location if self.type=="f" and self.location<6 and self.line[self.location+1]==0: self.line[self.location+1]=self self.line[self.location]=0 self.location += 1 if self.type == "t" and self.location>0 and self.line[self.location-1]==0: self.line[self.location - 1] = self self.line[self.location] = 0 self.location -= 1 def jump(self): self.last_location = self.location if self.type == "f" and self.location<5 and self.line[self.location+1].type=="t" and self.line[self.location + 2] == 0: self.line[self.location + 2] = self self.line[self.location] = 0 self.location += 2 if self.type == "t" and self.location>1 and self.line[self.location-1].type=="f" and self.line[self.location - 2] == 0: self.line[self.location - 2] = self self.line[self.location] = 0 self.location -= 2 def option(self): option=[] if self.type == "f" and self.location<6 and self.line[self.location + 1] == 0: option.append("m") elif self.type == "t" and self.location>0 and self.line[self.location - 1] == 0: option.append("m") elif self.type == "f" and self.location<5 and self.line[self.location + 1].type == "t" and self.line[self.location + 2] == 0: option.append("j") elif self.type == "t" and self.location>1 and self.line[self.location - 1].type == "f" and self.line[self.location - 2] == 0: option.append("j") else: option.append("n") return option[-1] def undo_move(self): if self.line[self.last_location]==0: self.line[self.location]=0 self.line[self.last_location]=self self.location,self.last_location=self.last_location,self.location def __repr__(self): return f"{self.type}{self.location}" #: מכאן אנו מתחילים לייצר את המופעים של המחלקה שלנו Line=[] Line.append(Creature("f",0,Line)) Line.append(Creature("f",1,Line)) Line.append(Creature("f",2,Line)) Line.append(0) Line.append(Creature("t",4,Line)) Line.append(Creature("t",5,Line)) Line.append(Creature("t",6,Line)) #-זו פונקציה שאומרת מתי סיימנו עם החידה הזו def check_solve(line): if line[3]==0: if line[0].type=="t" and line[1].type=="t"and line[2].type=="t" and line[4].type=="f" and line[5].type=="f" and line[6].type=="f": return True # -כאן אנו מתחילים עם הפונקציה הרקורסיבית שפותרת את החידה def solve (line): l=line[::] #מתוך הרשימה אנו יוצרים אובייקט חדש ולא רק מצביע נוסף לאותה רשימה print(line) if check_solve(line): print(line,"the end") exit() else: for p,v in enumerate(l): #כאן מתחילים את האיטרציה על האובייקט החדש שהופק מהרשימה moj = 0 #זה מיועד להראות שאכן ביצענו קפיצה או תזוזה של משהו if v==0 or v.option()=="n": #כאשר אנו נתקלים ב-0 או כשאין אפשרות תזוזה ממשיכים continue z = l.index(0) #המיקום של 0 ברשימה ילמד אותנו לאן עתיד היצור לזוז if v.option()=="j": line[p].jump() moj+=1 elif v.option() == "m": line[p].move() moj += 1 solve(line) #זאת הרקורסיה בהתגלמותה if moj>0: line[z].undo_move() #כך משיבים הכל למקום כשלא הושלם הפתרון solve(Line) #כך משתמשים במחלקה שבנינו >>> הפתרון כתוצאה מהרצת התוכנית נראה כך - [f0, f1, f2, 0, t4, t5, t6] [f0, f1, 0, f3, t4, t5, t6] [f0, 0, f2, f3, t4, t5, t6] [0, f1, f2, f3, t4, t5, t6] [f0, f1, t2, f3, 0, t5, t6] [f0, f1, t2, 0, f4, t5, t6] [f0, 0, t2, f3, f4, t5, t6] [0, f1, t2, f3, f4, t5, t6] [t0, f1, 0, f3, f4, t5, t6] [t0, 0, f2, f3, f4, t5, t6] [t0, f1, 0, f3, f4, t5, t6] [t0, 0, f2, f3, f4, t5, t6] [t0, f1, f2, t3, f4, 0, t6] [t0, f1, f2, t3, 0, f5, t6] [t0, f1, 0, t3, f4, f5, t6] [t0, 0, f2, t3, f4, f5, t6] [t0, t1, f2, 0, f4, f5, t6] [t0, t1, 0, f3, f4, f5, t6] [t0, t1, f2, 0, f4, f5, t6] [t0, t1, 0, f3, f4, f5, t6] [t0, t1, f2, f3, t4, f5, 0] [t0, t1, f2, f3, t4, 0, f6] [t0, t1, f2, 0, t4, f5, f6] [t0, t1, 0, f3, t4, f5, f6] [t0, t1, t2, f3, 0, f5, f6] [t0, t1, t2, 0, f4, f5, f6] [t0, t1, t2, 0, f4, f5, f6] the end זו לא הדרך הקצרה ביותר, אבל זו דרך לדעת שיש פתרון לחידה שלנו.10
- חברים במדברIn General Discussions23 באפריל 2019הפתרון מורכב משתי פונקציות בלבד - הראשונה מוצאת מה האפשרויות הנובעות מכל מצב - כאשר המצב ההתחלתי שלנו הוא [12,0,0] כלומר כלי אחד מלא ב- 12 ליטר מים ושני כלים ריקים. כל רשימה כוללת שלושה איברים, השמאלי ביותר מייצג כלי בנפח 12 ליטר, האמצעים כלי בנפח 8 ליטר והימני כלי בנפח 5 ליטר. כל מספר ברשימה מייצג כמה מים יש בכלי. def desert_options(lista): options=[] max_opt=[] max_opt.append(12-lista[0]) max_opt.append(8-lista[1]) max_opt.append(5-lista[2]) for place, item in enumerate (lista): for p,i in enumerate(max_opt): if item>0: if place !=p: if i>0: if item>i: opt=lista[::] #מוכרחים לייצר אובייקט חדש ולא מצביע בלבד opt[place]=item-i opt[p]=opt[p]+i options.append(opt) if item<i: opt = lista[::] opt[place]=0 opt[p]=opt[p]+item options.append(opt) return options answer = [[12,0,0]] #השלב ההתחלתי שלנו def solve_desert(): #הפונקציה השניה הפותרת את החידה if [6,6,0] in answer: #ששה ליטרים בשני הכלים הגדולים זה מה שמחפשים print(answer) exit() else: for item in desert_options(answer[-1]): #אנו תמיד עובדים על האיבר האחרון בתהליך if item not in answer: #על מנת שלא נשוב לנקודה שכבר היינו בה answer.append(item) solve_desert() #זו הרקורסיה answer.pop() #זה מחזיר את המצב לקדמותו solve_desert() #כאן קוראים לפונקציה הפונקציה הרקורסיבית שלנו מכילה תנאי מפסיק והוא שיהיה שלב בתהליך השווה ל- [6,6,0] כלומר חילקנו 12 ליטרים של מים בין שני המתייבשים שלנו. הפתרון הראשון המתקבל (שלאחריו הפונקציה מפסיקה לעבוד הוא - answer: >>> [[12, 0, 0], [4, 8, 0], [0, 8, 4], [8, 0, 4], [8, 4, 0], [3, 4, 5], [3, 8, 1], [11, 0, 1], [11, 1, 0], [6, 1, 5], [6, 6, 0]] אבל זה אינו הפתרון הקצר ביותר - הוא כולל עשרה שלבים אחרי המצב ההתחלתי. אם נותנים לפונקציה לרוץ מגלים גם פתרון יותר קצר - answer: [[12, 0, 0], [4, 8, 0], [4, 3, 5], [9, 3, 0], [9, 0, 3], [1, 8, 3], [1, 6, 5], [6, 6, 0]] הכולל שבעה שלבים אחרי המצב ההתחלתי 12,0,0 - קבלו משימה לשנות את הקוד כך שיפלוט את הפתרון הקצר ביותר בלבד.10
- כוורת חוזרת בפעם ה- 19In General Discussions23 באפריל 2019ראשית עשיתי חישוב מתמטי פשוט כדי לדעת מה צריך להיות הסכום של כל שורה וכל אלכסון. היות שיש לנו חמש שורות בלוח, כל שורה צריכה להכיל את אותו המספר. סכום כל המספרים מ-1 עד 19 הוא 190. לחלק ב- חמש שורות (או חמישה אלכסונים) יוצא 38 לכל שורה או אלכסון. בהתחלה לקחתי את הלוח והפכנו אותו לרשימה של 19 איברים, שבכל אחד מהם מוצב המספר 0 בהתחלה. המספר הראשון ברשימה מצד שמאל הוא התא השמאלי העליון בלוח. והמספר האחרון ברשימה הוא התא הימני התחתון בלוח כמו שמתואר בצילום הבא - את הפתרון מצאתי בעזרת שיטת הbacktracking המפורסמת שבעצם בודקת את כל האפשרויות המתאימות לתנאי השאלה. לכל איבר ברשימה התוכנה בודקת את האפשרויות לפי תנאי השאלה וכל פעם היא חוזרת שלבים במקרה שאין אפשרויות המתאימות לתנאים. התוכנית לא אלגנטית במיוחד ורצה במחשב שלי ב- 110 שניות(שזה יחסית הרבה). אבל היא עובדת ומוציאה 12 פתרונות שהם בעצם אותו הפתרון רק מסובב ומראה. הקוד: board = [0 for i in range(19)] possibilities = [i for i in range(1,20)] for item0 in possibilities[::]: board[0] = item0 p1 = possibilities[::] for i in range(1): p1.remove(board[i]) rp1 = [] for item in p1: if board[0]+item < 38 and board[0]+item > 18: rp1.append(item) for item1 in rp1: board[1] = item1 p2 = possibilities[::] for i in range(2): p2.remove(board[i]) rp2 = [] for item in p2: if board[0]+board[1]+item == 38: rp2.append(item) for item2 in rp2: board[2] = item2 p3 = possibilities[::] for i in range(3): p3.remove(board[i]) rp3 = [] for item in p3: if board[0]+item < 38 and board[0]+item > 18: rp3.append(item) for item3 in rp3: board[3] = item3 p4 = possibilities[::] for i in range(4): p4.remove(board[i]) rp4 = [] for item in p4: if board[0]+item < 38 and board[1]+item < 38 and board[0]+item < 38: rp4.append(item) for item4 in rp4: board[4] = item4 p5 = possibilities[::] for i in range(5): p5.remove(board[i]) rp5 = [] for item in p5: if board[1]+item < 38 and board[2]+item < 38 and board[3]+board[4]+item < 38 and board[3]+board[4]+item > 18: rp5.append(item) for item5 in rp5: board[5] = item5 p6 = possibilities[::] for i in range(6): p6.remove(board[i]) rp6 = [] for item in p6: if board[3]+board[4]+board[5]+item == 38 and board[2]+item < 38 and board[2]+item > 18: rp6.append(item) for item6 in rp6: board[6] = item6 p7 = possibilities[::] for i in range(7): p7.remove(board[i]) rp7 = [] for item in p7: if board[0]+board[3]+item == 38: rp7.append(item) for item7 in rp7: board[7] = item7 p8 = possibilities[::] for i in range(8): p8.remove(board[i]) rp8 = [] for item in p8: if board[3]+item < 38 and board[7]+item < 38 and board[1]+board[4]+item < 38 and board[1]+board[4]+item > 18: rp8.append(item) for item8 in rp8: board[8] = item8 p9 = possibilities[::] for i in range(9): p9.remove(board[i]) rp9 = [] for item in p9: if board[0]+board[4]+item < 38 and board[2]+board[5]+item < 38 and board[7]+board[8]+item < 38: rp9.append(item) for item9 in rp9: board[9] = item9 p10 = possibilities[::] for i in range(10): p10.remove(board[i]) rp10 = [] for item in p10: if board[7]+board[8]+board[9]+item < 38 and board[7]+board[8]+board[9]+item > 18 and board[1]+board[5]+item < 38 and board[1]+board[5]+item > 18 and board[6]+item < 38: rp10.append(item) for item10 in rp10: board[10] = item10 p11 = possibilities[::] for i in range(11): p11.remove(board[i]) rp11 = [] for item in p11: if board[2]+board[6]+item == 38 and board[7]+board[8]+board[9]+board[10]+item == 38: rp11.append(item) for item11 in rp11: board[11] = item11 p12 = possibilities[::] for i in range(12): p12.remove(board[i]) rp12 = [] for item in p12: if board[7]+item < 38 and board[7]+item > 18 and board[1]+board[4]+board[8]+item == 38: rp12.append(item) for item12 in rp12: board[12] = item12 p13 = possibilities[::] for i in range(13): p13.remove(board[i]) rp13 = [] for item in p13: if board[12]+item < 38 and board[2]+board[5]+board[9]+item < 38 and board[2]+board[5]+board[9]+item > 18 and board[3]+board[8]+item < 38 and board[3]+board[8]+item > 18: rp13.append(item) for item13 in rp13: board[13] = item13 p14 = possibilities[::] for i in range(14): p14.remove(board[i]) rp14 = [] for item in p14: if board[0]+board[4]+board[9]+item < 38 and board[0]+board[4]+board[9]+item > 18 and board[6]+board[10]+item < 38 and board[6]+board[10]+item > 18 and board[12]+board[13]+item < 38 and board[12]+board[13]+item > 18: rp14.append(item) for item14 in rp14: board[14] = item14 p15 = possibilities[::] for i in range(15): p15.remove(board[i]) rp15 = [] for item in p15: if board[1]+board[5]+board[10]+item == 38 and board[12]+board[13]+board[14]+item == 38 and board[11]+item < 38 and board[11]+item > 18: rp15.append(item) for item15 in rp15: board[15] = item15 p16 = possibilities[::] for i in range(16): p16.remove(board[i]) rp16 = [] for item in p16: if board[7]+board[12]+item == 38 and board[2]+board[5]+board[9]+board[13]+item == 38: rp16.append(item) for item16 in rp16: board[16] = item16 p17 = possibilities[::] for i in range(17): p17.remove(board[i]) rp17 = [] for item in p17: if board[3]+board[8]+board[13]+item == 38 and board[6]+board[10]+board[14]+item == 38 and board[16]+item < 38 and board[16]+item > 18: rp17.append(item) for item17 in p17: board[17] = item17 p18 = possibilities[::] for i in range(18): p18.remove(board[i]) rp18 = [] for item in p18: if board[16]+board[17]+item == 38 and board[11]+board[15]+item == 38 and board[0]+board[4]+board[9]+board[14]+item == 38: rp18.append(item) for item18 in rp18: board[18] = item18 print(board) >>> [3, 17, 18, 19, 7, 1, 11, 16, 2, 5, 6, 9, 12, 4, 8, 14, 10, 13, 15] [3, 19, 16, 17, 7, 2, 12, 18, 1, 5, 4, 10, 11, 6, 8, 13, 9, 14, 15] [9, 11, 18, 14, 6, 1, 17, 15, 8, 5, 7, 3, 13, 4, 2, 19, 10, 12, 16] [9, 14, 15, 11, 6, 8, 13, 18, 1, 5, 4, 10, 17, 7, 2, 12, 3, 19, 16] [10, 12, 16, 13, 4, 2, 19, 15, 8, 5, 7, 3, 14, 6, 1, 17, 9, 11, 18] [10, 13, 15, 12, 4, 8, 14, 16, 2, 5, 6, 9, 19, 7, 1, 11, 3, 17, 18] [15, 13, 10, 14, 8, 4, 12, 9, 6, 5, 2, 16, 11, 1, 7, 19, 18, 17, 3] [15, 14, 9, 13, 8, 6, 11, 10, 4, 5, 1, 18, 12, 2, 7, 17, 16, 19, 3] [16, 12, 10, 19, 2, 4, 13, 3, 7, 5, 8, 15, 17, 1, 6, 14, 18, 11, 9] [16, 19, 3, 12, 2, 7, 17, 10, 4, 5, 1, 18, 13, 8, 6, 11, 15, 14, 9] [18, 11, 9, 17, 1, 6, 14, 3, 7, 5, 8, 15, 19, 2, 4, 13, 16, 12, 10] [18, 17, 3, 11, 1, 7, 19, 9, 6, 5, 2, 16, 14, 8, 4, 12, 15, 13, 10]10
- גן החיות בפלורידה - חידת פייתוןIn General Discussions19 באפריל 2019כתבנו רבות על הספרייה itertools ונפלאותיה, כמו על יכולתה, בעיקר כאשר לא עוסקים ברשימה ארוכה מידי, לייצר במהירות את כל האפשרויות (במקרה שלנו לסידור החיות בשורה) כאשר אין חזרה על חיה אחת פעמיים (במקרה הזה המתודה נקראת permutations). כל מה שנותר לנו לעשות הוא לבחון את קיום כל תנאי החידה ובום... יש פתרון - import itertools zoo=["cat","dog","elefant","horse","giraffe","lion","monkey"] def check_zoo(zoo): if zoo.index("cat")-zoo.index("dog")==1: if zoo.index("giraffe")>zoo.index("elefant")>zoo.index("horse") or zoo.index("horse")>zoo.index("elefant")>zoo.index("giraffe"): if zoo.index("lion")==3: if abs(zoo.index("dog")-zoo.index("monkey"))==2: if abs(zoo.index("giraffe")-zoo.index("dog"))==4: if zoo.index("cat")>zoo.index("horse"): return True return False zoo_permutations=itertools.permutations(zoo) for line in zoo_permutations: if check_zoo(line): print(line) הפתרון היחיד המתקבל - ('giraffe', 'elefant', 'horse', 'lion', 'dog', 'cat', 'monkey')10
- viewing pornographyIn General Discussions26 במרץ 2024Pornography websites are a significant part of the online landscape, offering a wide range of adult content catering to diverse tastes and preferences. While some may find them objectionable, others view them as a form of entertainment and sexual exploration.00
- viewing pornographyIn General Discussions22 במרץ 2024Support Ethical Production Practices: Consider supporting adult websites and performers that prioritize ethical production practices, such as porn fair compensation, consent, and safe working conditions. Look for platforms that promote positive representations of sexuality and advocate for diversity and inclusivity within the industry. By endorsing ethical production, you contribute to a healthier and more equitable adult entertainment ecosystem.00
- Can Vidalista be taken on an empty stomach?In General Discussions21 במרץ 2024Yes, Vidalista Tablet can be taken on an empty stomach or with food, as it does not require a specific dietary regimen for effectiveness. However, consuming a heavy meal high in fat content may delay the onset of action of Vidalista. For optimal results, it's recommended to take Vidalista 2.5 approximately 30 minutes to 1 hour before anticipated sexual activity. Consult your healthcare provider for personalized advice on the best way to take Vidalista based on your individual needs and health condition. Medzsite00
- פרויקט כחלק מקורס תכנותIn General Discussions16 במרץ 2024Best Chandigarh escorts service in low price Chandigarh independent call girls agency If you are looking for the best escorts service then please contact us or get the best service only at low price . The best Escorts service in Chandigarh is our company in which you can have sex with VIP models and enjoy. Chandigarh independent call girls contact:-0000000001 visit:-https://www.callgirlsrani.com/ https://www.callgirlsrani.com/chandigarh-escorts-call-girls.html00
- פרויקט כחלק מקורס תכנותIn General Discussions16 במרץ 2024Best Chandigarh escorts service in low price Chandigarh independent call girls agency If you are looking for the best escorts service then please contact us or get the best service only at low price . The best Escorts service in Chandigarh is our company in which you can have sex with VIP models and enjoy. Chandigarh independent call girls Contact :-9877773777 Visit:-https://www.chandigarhescorts.in/00
- פרויקט כחלק מקורס תכנותIn General Discussions9 במרץ 2024Dear Friends my name is Mahak Aggarwal. I am a Punjabi girl lives in mall road, Mussoorie for my higher studies. Me and some of my North indian friends working as a Punjabi escorts in haridwar for some extra money. call girls in haridwar call girl in haridwar haridwar call girls haridwar call girl haridwar escort service call girls in rishikesh call girl in rishikesh rishikesh call girls rishikesh call girl rishikesh escort service call girls in haridwar call girl in haridwar haridwar call girls haridwar call girl haridwar escort service call girls in haridwar call girl in haridwar haridwar call girls haridwar call girl haridwar escort service call girls in mussoorie call girl in mussoorie mussoorie call girls mussoorie call girl mussoorie escort service00
- I'm looking for quality images of black womenIn General Discussions7 במרץ 2024Hello, I have a great place to find beautiful and diverse black woman images - Depositphotos. They offer a huge selection of high quality photos that are suitable for various projects. I use this resource often and am always satisfied with the results. They have a wide range of images of different subjects, including black women. The quality is always top-notch, and the easy search helps you quickly find what you need for your project.00
- Best casino everIn General Discussions29 בפברואר 2024Hey everyone, I came across an interesting recommendation in our discussions and thought it might be worth sharing for those who haven't seen it yet. If you're looking for some exciting gaming and betting opportunities, you might want to check out GG Bet's promotions page. They https://ggbet.world/en/promotions offer a variety of promotions that cater to different interests, whether you're into esports betting or casino games. It's a great way to enhance your gaming experience with some extra perks. Always remember to gamble responsibly and ensure it's legal in your area. Let's keep our community discussions diverse and informative by sharing more gems like this!00
- How do people navigate potential challenges or discomfort that may arise from watching porn with a partner?In General Discussions27 בפברואר 2024Your emphasis on open communication and establishing mutual boundaries when watching porn videos with a partner is crucial. It's essential to create a consensual environment where both individuals feel comfortable and respected in their choices.00
bottom of page