DEV Community

Onaolapo-11
Onaolapo-11

Posted on

I completed Module 2 (Python Data Structures) of Python for Data Science, AI & Development Course (IBM) (Santarcangelo, n.d.)

Day 76 [November 24, 2025]

I need to buckle down, as I'm still lagging on day day 3 & 4 goals, "Day 3-4: Control structures (if-else, loops)", as well as day 5 (and 6) goals, "Day 5-6: Functions and modules", and Day 7 target (exercises) (Meta AI, personal communication, August 8, 2025). If I haven't covered this, I can't make progress on day 8 - 75 goals.

Goals:
As extracted from the 'Python for Software Development' textbook by Halvorsen (n.d.):

  • Plotting in Python ✅
  • Subplots✅
  • Exercises✅
  • If ... Else
  • Arrays
  • For Loops
  • Nested
  • For Loops
  • While Loops
  • Exercises
  • Creating Functions in Python - Introduction
  • Functions with multiple return values
  • Exercises
  • Creating Classes in Python
  • The init () Function
  • Exercises
  • Creating Python Modules
  • Exercises

Notes:
Python for Data Science, AI & Development Course (IBM) (Santarcangelo, n.d.):
Module 2: Python Data Structures

  • Lists and Tuples
  • Dictionaries
  • Sets

Sets:

  • used for the storage of values that are distinct
  • "append() adds an object as a single element, while extend() adds each element of an iterable individually". Check using the code below:

list = [2,3,4]
list.append([3])
print(list)

list2 = [2,3,4]
list2.extend([3]) #note the difference here
print(list2)

Outputs:
[2, 3, 4, [3]]
[2, 3, 4, 3]

Otherwise,
list2 = [2,3,4]
list2.extend(3) #note the difference here
print(list2)
will give TypeError: 'int' object is not iterable

  • Both sum() and len() functions work for Tuples, but the difference is sum() adds the elements (must be int or float type), while len() counts the elements.

ages = (20,3,34)
print(sum(ages))
print(len(ages))

Outputs:
57
3

Summary:
I completed Module 2 (Python Data Structures) of Python for Data Science, AI & Development Course (IBM) (Santarcangelo, n.d.).

References:

  1. Halvorsen, H. (n.d.). Python. https://halvorsen.blog/documents/programming/python/python.php#python4

  2. Santarcangelo, J. (n.d.). Python for data science, AI & development [MOOC]. Coursera. https://coursera.org/learn/python-for-applied-data-science-ai

Top comments (0)