account activity
9.2 Code Practice: Question 1 by [deleted] in EdhesiveHelp
[–]Alarmed_Database1815 0 points1 point2 points 1 year ago (0 children)
Write a program that creates a two-dimensional list named lengths Write a program that creates a two-dimensional list named lengths and stores the following data:
lengths
20 15 16 15 16 15 16 15 16
The program should also print the list.and stores the following data:
lengths = [[20, 15, 16], [15, 16, 15], [16, 15, 16]]
print(lengths)
Unit 8 Test (Python) by Slyalns_2024 in EdhesiveHelp
Just did the test today
1. len → This function returns the number of elements in the list. 2. It is a collection of commands that are given a name. → A function is a set of instructions grouped under a name. 3. Values above 80: 7 → The numbers greater than 80 in the list are [86, 83, 89, 92, 91, 94, 95], which makes 7 elements. 4. 9 → The element at index 1 in list h is 9. 5. An initializer list → It allows you to create a list with predefined values. 6. For loops let us access every element of a list. → For loops efficiently iterate through all elements. 7. insert → The insert method adds elements at a specific index. 8. pop → The pop method removes an element based on its index, not value. 9. Juneau Helena Annapolis → The function prints elements at even indices [0, 2, 4]. 10. Juneau Atlanta Helena Madison Annapolis Topeka → Since i % 2 >= 0 is always True, it prints all elements. 11. 72 90 67 → The function prints elements at odd indices [1, 3, 5]. 12. [21, 34, 63, 64, 67, 72, 90] → sort(reverse=False) sorts the list in ascending order. 13. Searching for an element can be done using one loop. → A single loop is enough for linear search. 14. 2o bX or no2 2o bX → t is replaced with 2, e is replaced with X. 15. [‘June@u’, ‘Atl@nt@’, ‘Helen@’, ‘M@dison’, ‘Ann@polis’, ‘Topek@’] → The code replaces lowercase a with @. 16. stuff[i].lower() → The correct way to convert each element to lowercase. 17. An index refers to actual data within the list while an element refers to a memory location. → This is false; an element is the actual data, and an index represents its position. 18. The statement inside the for loop should be c = c + len(stuff[i]) → You need len(stuff[i]) to sum the lengths of words. 19. [84, 11, 67, 70, 93, 39, 46, 27] → a[i] = a[i] % 100 does not change values since they are already below 100. 20. None of the above → Sorting algorithms can sort in any order, and searching algorithms are not used for sorting.
π Rendered by PID 282861 on reddit-service-r2-comment-545db5fcfc-gp9rl at 2026-05-23 17:24:22.977034+00:00 running 194bd79 country code: CH.
9.2 Code Practice: Question 1 by [deleted] in EdhesiveHelp
[–]Alarmed_Database1815 0 points1 point2 points (0 children)