Python Forum
[Basic] The ‘Pythonic’ Python Tutorial!
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Basic] The ‘Pythonic’ Python Tutorial!
#2
Succinct and easy to follow is not enough. Information provided must be correct as well. Therefore my feedback not very positive. It's good to put effort into writing tutorial but result is not ready for distribution.

I randomly opened one chapter (Lists) and read:

Quote:A list is an ordered set of objects in Python.

Hmm.... 'ordered set of objects'? As set is itself datatype of Python ('A set object is an unordered collection of distinct hashable objects.') meaning of this definition is: ordered unordered /blablabla/.

No good. Stick to the definition provided in documentation: "Lists are mutable sequences"

So I went to check next definition (Tuples) and read:

Quote:A tuple is a collection which is ordered and unchangeable. Tuples are similar to lists except that their elements are immutable. Once a tuple is created, the elements, the order of the elements & number of elements can't be changed.

Tuple definition in documentation: 'Tuples are immutable sequences'

Immutable and unchangeable are not the same:

>>> t = ([1, 2, 3], [3, 5, 6])          # tuple with two mutable elements (contrary to definition in tutorial)
>>> t[1].append(7)                      # change second element  (contrary to definition in tutorial)
>>> t                                   # both element in tuple itself has changed (contrary to definition in tutorial)
([1, 2, 3], [3, 5, 6, 7])
From documentation:

Quote:The value of some objects can change. Objects whose value can change are said to be mutable; objects whose value is unchangeable once they are created are called immutable. (The value of an immutable container object that contains a reference to a mutable object can change when the latter’s value is changed; however the container is still considered immutable, because the collection of objects it contains cannot be changed. So, immutability is not strictly the same as having an unchangeable value, it is more subtle.)

I didn't look any further, but please correct these definitions at least. I recommend to read following sections of Python documentation:

Set types - set, frozenset
Lists
Tuples
Datamodel - Objects, values and types
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: [Basic] The ‘Pythonic’ Python Tutorial! - by perfringo - Feb-07-2020, 10:03 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Basic] Basic Python Tutorial (Playlist) coffeejunkie34 0 880 Sep-28-2023, 12:18 PM
Last Post: coffeejunkie34
  Is there a good tutorial on installing Python correctly on Windows? CynthiaMoore 4 2,147 Aug-31-2022, 12:47 PM
Last Post: snippsat
  Complete Python Tutorial jamessidis 2 5,287 Dec-04-2020, 07:48 PM
Last Post: khalifa
  [Basic] Python Tutorial for Beginners MK_CodingSpace 0 2,218 Dec-03-2020, 09:43 PM
Last Post: MK_CodingSpace
  Python Scrapy Tutorial Knight18 0 3,963 Oct-19-2020, 04:56 PM
Last Post: Knight18
  12 mini games python tutorial series ninedeadeyes 2 2,447 Feb-16-2020, 11:18 PM
Last Post: ninedeadeyes
  [Basic] Python Tutorial for Beginners in One Lesson (98 minutes) artur_m 0 4,049 Jan-23-2020, 09:15 AM
Last Post: artur_m
  Complete Python 3 Tutorial Series KodeBlog 0 5,193 Sep-06-2019, 10:00 AM
Last Post: KodeBlog
  Tutorial for Python, Flask > data into a form Ecniv 1 2,430 May-01-2019, 07:49 PM
Last Post: Larz60+
  Python tutorial on learning & creating your own LRU Cache :) ncorbuk 0 3,507 Jan-26-2019, 08:28 PM
Last Post: ncorbuk

Forum Jump:

User Panel Messages

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