DEV Community

Kudzai Murimi
Kudzai Murimi

Posted on

What to note first when learning Python??

Here are some key things to note when learning Python:

Indentation is important: Python uses indentation (spaces) to define scope, instead of braces {}. So proper indentation is required for your code to work.

Python is dynamically typed: You don't need to declare variables with a type, and types can change. For example, you can do:

x = 5     # x is an int
x = "John" # now x is a string
Enter fullscreen mode Exit fullscreen mode

Python uses new lines to end statements: No need for semicolons ; at the end of each statement. New lines imply the end of a statement.

Python has a simple syntax: Python code is very clean and readable. It has a simple and consistent syntax.

Python has a rich set of libraries: Python comes with a vast set of libraries (collections of pre-written code) that can be used for various tasks like scientific computing, web development, software engineering, etc.

Python supports multiple programming paradigms: Python supports OOP (with classes and inheritance), procedural programming (with functions), and functional programming (with lambda). So you have flexibility in how you want to solve a problem.

Python has an interactive shell: The Python REPL (Read-Eval-Print-Loop) allows you to quickly test snippets of code. It's a great way to explore the language.

Python uses whitespace for scope: The scope of variables is defined by indentation (whitespace) rather than brackets. So no variable declarations needed!

Python has simple data types: The main data types in Python are lists, tuples, sets, dictionaries, strings, numbers, and Booleans.

Python is interpreted: Python code is compiled into bytecode, then executed by the Python interpreter. So no need to compile your code before executing it.

Top comments (0)