Python Forum
[Basic] Working With Python 3 Lists | Learn By Examples
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Basic] Working With Python 3 Lists | Learn By Examples
#1
Hi, I recently wrote a tutorial on Python 3 lists where you can learn by examples.

Do check it out and let me know your feedback.
Reply
#2
At lest the following issues I could point out:
1) In the example starting with Numbers = [23, 34, 43, 67] ..., your are talking about 5-th element in the list. It slightly confuses, because there is no fifth element in that list.
2) You listed methods of the list class. However, method names are started with uppercased letter; if I'm learning python and don't know anything, I would try, e.g. list.Append and get the error. Since Python is case-sensitive, you listed wrong method names (there is no such method Append, but append exists).
3) In the section "Python program to check if element exists in the list"; I would expect your code returns a boolean; However, there is .index method which do the same as your code snippet; and in keyword to check if the elemnt is in the list.
4) ...use an in-built function called copy()... It is method, not a function. You probably need to provide some details about this method. Discover: It returns shallow or deep copy of a list.
5) In section: "Python program to count occurrences of an element in a list"; You provide a code snippet, however, there is .count method which solves the problem.
6) 8. Python program to find the sum of elements in the list. What about sum builtin function?
7) In section: "Python program to find the smallest number in a list". You sorted an array to find its minimal element. Sorting is quite heavy operation, its complexity O(N log N); It is better to traverse the list and find the smallest element with O(N) operations; what about min builtin function;
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Basic] Learn Python 3 In 24 Hours fuzzy_tech 2 3,167 Dec-07-2020, 05:22 PM
Last Post: Uly_0_0_1
  [Basic] Dictionary In Python 3 | Learn With Examples CodeItBro 1 4,845 Aug-17-2020, 11:16 PM
Last Post: micseydel
  Hashing Passwords – Python Cryptography Examples wagslane 0 3,770 Jan-29-2020, 04:15 PM
Last Post: wagslane
  [Basic] Introduction to Python Through Examples tmose1106 0 2,622 Jul-08-2018, 07:09 PM
Last Post: tmose1106

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020