Python Course Started, Alhamdulillah

The Python Mega Course: Build 10 Real World Applications

Bismillahir Rahmanir Rahim. I am exploring this course for growing interest in my career:

Summary: Integers, Floats, Lists, Dictionaries, Tuples, dir, help

In this section you learned that:

  • Integers are for representing whole numbers:
  1. rank = 10
  2. eggs = 12
  3. people = 3
  • Floats represent continuous values:
  1. temperature = 10.2
  2. rainfall = 5.98
  3. elevation = 1031.88
  • Strings represent any text:
  1. message = “Welcome to our online shop!”
  2. name = “John”
  3. serial = “R001991981SW”
  • Lists represent arrays of values that may change during the course of the program:
  1. members = [“Sim Soony”, “Marry Roundknee”, “Jack Corridor”]
  2. pixel_values = [252, 251, 251, 253, 250, 248, 247]
  • Dictionaries represent pairs of keys and values:
  1. phone_numbers = {“John Smith”: “+37682929928”, “Marry Simpons”: “+423998200919”}
  2. volcano_elevations = {“Glacier Peak”: 3213.9, “Rainer”: 4392.1}
  • Keys of a dictionary can be extracted with:
  1. phone_numbers.keys()
  • Values of a dictionary can be extracted with:
  1. phone_numbers.values()
  • Tuples represent arrays of values that are not to be changed during the course of the program:
  1. vowels = (‘a’, ‘e’, ‘i’, ‘o’, ‘u’)
  2. one_digits = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
  • To find out what attributes a type has:
  1. dir(str)
  2. dir(list)
  3. dir(dict)
  • To find out what Python builtin functions there are:
  1. dir(__builtins__)
  • Documentation for a Python command can be found with:
  1. help(str)
  2. help(str.replace)
  3. help(dict.values)
It would be a great help, if you support by sharing :)
Author: zakilive

Leave a Reply

Your email address will not be published. Required fields are marked *