316316print (f"Words: { words } " )
317317
318318print ("\n === End of Tutorial ===" )
319- print ("Practice tip: Try modifying the values and see how the results change!" )
319+ print ("Practice tip: Try modifying the values and see how the results change!" )
320+
321+ # =============================================================================
322+ # 11. SUMMARY TABLE OF PYTHON DATA TYPES
323+ # =============================================================================
324+
325+ print ("--- Summary of Python Data Types ---\n " )
326+
327+ data_types_summary = [
328+ ("int" , "Whole numbers (e.g., 5, -10, 2025)" ),
329+ ("float" , "Decimal numbers (e.g., 3.14, -2.5)" ),
330+ ("complex" , "Numbers with real and imaginary parts (e.g., 2 + 3j)" ),
331+ ("str" , "Sequence of characters (e.g., 'Hello')" ),
332+ ("bool" , "Boolean values True or False" ),
333+ ("list" , "Ordered, mutable collection (e.g., [1, 2, 3])" ),
334+ ("tuple" , "Ordered, immutable collection (e.g., (1, 2, 3))" ),
335+ ("dict" , "Key-value pairs (e.g., {'name': 'Alice', 'age': 25})" ),
336+ ("set" , "Unordered collection of unique elements (e.g., {1, 2, 3})" ),
337+ ]
338+
339+ print (f"{ 'Data Type' :<10} | Description" )
340+ print ("-" * 50 )
341+ for dtype , desc in data_types_summary :
342+ print (f"{ dtype :<10} | { desc } " )
343+
344+ print ("\n 💡 Tip: Use the 'type()' function to check any variable’s data type!" )
345+ print ("\n === End of Extended Tutorial ===" )
0 commit comments