creates a 4x4 2D array named my_2d_array containing strings, initialises an empty string variable named diagonal1 to store the concatenated elements along the main diagonal of the 2D array, the outer for row in range(len(my_2d_array)) loop iterates through the rows of the 2D array, the inner for col in range(len(my_2d_array[row])) loop iterates through the columns within each row, checks if the current row index is equal to the current col index. In which case, we have a diagonal, appends (concatenates) the string value at my_2d_array[row, col] to the diagonal1 string, prints the concatenated elements along the main diagonal by displaying the content of the diagonal1 variable.
0%
SDD Implementation - 2D arrays (Describing Code 3)
שתף
שתף
שתף
על ידי
Gw09brucejennif
עריכת תוכן
הדפסה
הטבעה
עוד
הקצאות
לוח תוצאות מובילות
הצג עוד
הצג פחות
לוח התוצאות הזה הוא כרגע פרטי. לחץ
שתף
כדי להפוך אותו לציבורי.
לוח תוצאות זה הפך ללא זמין על-ידי בעל המשאב.
לוח תוצאות זה אינו זמין מכיוון שהאפשרויות שלך שונות מאשר של בעל המשאב.
אפשרויות חזרה
דיאגרמה עם תוויות
היא תבנית פתוחה. זה לא יוצר ציונים עבור לוח התוצאות.
נדרשת כניסה
סגנון חזותי
גופנים
נדרש מנוי
אפשרויות
החלף תבנית
הצג הכל
תבניות נוספות יופיעו במהלך המשחק.
תוצאות פתוחות
העתק קישור
קוד QR
מחיקה
האם לשחזר את הנתונים שנשמרו באופן אוטומטי:
?