8.  bytearray data type:

  • This data type is similar to bytes data type but it is mutable.
  • The bytearray() method returns a bytearray object which is an array of the given bytes.


  • Collection Related data type summary:

None data type:

  • None means nothing à No value associated.
  • The None keyword is used to define a null variable or an object.
  • In Python, None keyword is an object, and it is a data type of the class NoneType.



  • None is not the same as False.
  • None is not 0.
  • None is not an empty string.
  • Comparing None to anything will always return False except None itself.
  • Escape Character:

  • Python will support various escape characters.
  • An escape character is a backslash \ followed by the character you want to insert.


Escape Character table:

\n Newline
\t Horizontal tab
\r Carriage return
\b Backspace
\a Bell or alarm
\’ Single Quote
\” Double Quote
\\ Backslash


  • Comments can be used to explain Python code.
  • Comments can be used to make the code more readable.
  • Comments start with a #, and Python will ignore them:

Ex: Single line comment

Ex2: Multiline comment


  • The recommended method for commenting multiple lines is using # on each line.
  • The (“””) method isn’t a comment but defines a Text constant of the text between the (“””).
  • It isn’t displayed, but exists and could potentially cause unexpected errors.
  • Constant In Python:
  • Python doesn’t support constants or it is not allowed constants.