Python Classroom Series – 25/Jul/2020

Our new character

  • Lets call that as Python3 Preview
  • Remember the good old Jarvis, we used to speak to the language and understanding capabilities of Jarvis, So the get the things done with python3 we need to do the same Preview
  • Lets try to understand Python3’s capabilities so that we can use python3 effectively

Python Conceptual Hierarchy

  • We all know that we are going to write code
  • We hear terms like Python program, module, expression & objects
  • Hierarchy
    1. Python Program(s)/Application(s) is/are composed of Modules
    2. Each Module contains Statements
    3. Statements contains expressions
    4. Expressions create & process objects
  • In Python everything which we create, update, delete is object Preview

Python3 has built-in types

  • Why built-in types ?
    1. Built-in Objects make programs easy to write
    2. Built-in Objects are often more effecient that custom data structure
    3. Built-in Objects are Part of Python

Python’s Core Data Types.

  • Built-in-objects are availabe in Python
    • Numbers => 1234,3.14,3+5j,0b111, Decimal, Fraction
    • Strings (Text) => ‘this is string with single quotes’, "This is string with double quotes"
    • Lists => [1,2,3], ["Red", "Green", "Yellow"], [1,"REd", [1,2,3] ], ["dog", "cat", "lion"]
    • Dictionaries
    • Tuples
    • Files
    • Sets
    • Boolean
    • None
    • Functions, modules, classes
    • Compiled code, stack tracebacks
  • Here some objects can be used directly, some require expressions such as def, class, import and lambda …

Operators

  • Operators allow us to perform operations on types or objects
  • Operators allow us to build the logic with data
  • Every data type will have some operators supported
 +,*, /, %, ==, != 


Numeric Types

  • Lets us find out what are different types of numeric data which can have in real world
integers
fractional numbers (floating point numbers)
Decimal/Octal/binary
Complex Numbers
Sets
  • to handle this real world data, python has datatypes for handling
    • Integer & floating point objects
    • Complex Number Objects
    • Decimal Objects
    • Fractional
    • Sets
  • Python also has operators to perform operations on this numeric types

Fun-time with numbers

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About learningthoughtsadmin