עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

הדפסת סידורי ספרות ממערך

Featured Replies

פורסם

צהריים טובים,

אשמח אם תוכלו לעזור לי, איך אפשר לממש בצורה רקורסיבית הדפסת כל הסידורים האפשריים של רצף ספרות אשר ניצא במערך.

למשל אם יש לי מערך שמכיל באינדקס 0 את הספרה 1, באינדקס 1 את 2 ובאינדקס 2 את 3, התוצאה צריכה להיות:

123

132

213

231

312

321

תודה רבה מראש.

פורסם

כל פעם אתה צריך להחליף בין 2 מקומות(כל פעם מקום אחר) בלולאה, ולהתקדם להחלפה הבאה(למקום הבא) ברקורסיה.

תדפיס את התוצאה רק כשאין לך יותר איברים להחליף.

משהו כזה:


def func(x, place = 0):
for index in range(place, len(x)):
x[place],x[index] = x[index], x[place]
func(x, place+1)
x[place],x[index] = x[index], x[place]
if place == len(x):
print (x)

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.