Python Essentials Classroom Series – 06/Jul/2021

Python Getting Started

  • Read-Evaluation-Print-Loop (REPL):
    • This REPL is a prompt that appears at which we can start typing our programs into so called REPL. Preview
    • You can exit out of REPL (interactive interpreter) by typing quit()
  • Python file:
    • Create a file called as helloworld.py and add some code
    print('Hello World Python')
    
    • Now execute the program by executing python helloworld.py

Compiler and Interpreter

  • Compiler converts source code into the machine understandable format

  • Interpreter converts the source code into the machine understandable format

  • Compiler is more or less like dubbing a movie

  • Intrepreter does the job like the translator

  • In Python when we run the python code, the python code is converted to Byte code using compiler and then is executed by interpreter.

Primitives, Variables and Expressions

  • Python provides a collection of primitive data types such as integers, floats, booleans and string Preview
  • Python tries to reuse the same memory location for low valued integers (less than or equal to 256) Preview
  • In python there is no need to explicity specify the type like in languages such as c int c = 0 we would rather use c=0
  • In python we can specify type hint for mere code readability
c: int = 0
  • Next Steps:
    • Mutable and Immutable.

Leave a Comment

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

About learningthoughtsadmin