Tutorial: Learning to think like a programmer with Python

in #utopian-io4 years ago (edited)

What Will I Learn?

This tutorial covers these topics:

  • Basic programming concepts
  • What is Python?
  • Installation of the work environment
  • Operate in the interactive development environment

Requirements

  • A PC/laptop with any Operating system such as Linux, Mac OSX, Windows OS.

Note: This tutorial is performed in Sublime Text 3 in laptop with Windows 7, 32 bit OS, Python 3.6.4.

Difficulty

  • Basic

Anyone without previous programming knowledge or novices can catch up with this tutorial.

Tutorial Contents

In this series of tutorials, we learn the Python programming language from scratch and we will advance to an advanced level. This will be the first part of the tutorial that will cover the topic of programming fundamentals.

What is programming?

Programming is simply giving instructions to the computer to perform a specific task.

The instructions (commands) have a different appearance in each programming language, but there are some basic functions that are presented in almost all languages:

  • Input: receives data from the keyboard, or from a file or other device.

  • Output: shows data on the monitors or sends data to a file or other device.

  • Mathematics: performs basic mathematical operations such as addition, subtraction, multiplication and division.

  • Conditional operation: confirm the veracity of any condition and execute a sequence of appropriate instructions.

  • Repeat: perform some action repeatedly, usually with some variation.

What is debugging?

When programming, mistakes are made and the process of searching for them and correcting them is called debugging.

There are three types of errors that can occur in a program, syntax, runtime, and semantics.

What is Python?

Python is a programming language created by Guido van Rossum at the beginning of the 90s, it is a powerful scripting language, with dynamic typing, easy to learn, multiplatform and object oriented.

Download Python

The official Python page is https://www.python.org/

The latest version of Python currently available (March 2018) is Python 3.6.4.

Links: Python 3.6.4 download page, Python 3.6.4 installers for 64-bit Windows (30.2 MB) and 32-bit Windows (29.2 MB).

Install Python

Once the installer is downloaded, we double click on it to start the installation.

  • Check the "Add Python to PATH" box to be able to execute programs from the command line. Then, click on "Install now".

  • The installation of Python can take several minutes.

  • We click on "Close" to finish the installation. You can start programming in Python!

Download Sublime Text

The official page of Sublime Text is https://www.sublimetext.com/

The latest version of Sublime Text currently available (March 2018) is Sublime Text 3.

Links: page of download of Sublime Text 3 , installers of Sublime Text 3 for Windows 64-bit (8.5 MB) and Windows 32 bit (7.8 MB).

Install Sublime Text

Once the installer is downloaded, we double-click on it to begin the installation.

  • We click on "Next"

  • "Next"

  • Check the box "Add to explorer context menu"

  • "Install".

  • We click on "Finish" to finish the installation.

All our IDE is already installed!

Operate in the interactive development environment

IDLE (Integrated Development Environment for Python) is the development environment that allows you to edit and execute programs. We can also create and execute programs in Python without using IDLE.

Open IDLE Home> Python 3.6> IDLE (Python 3.6)

  • The main IDLE window will open. This window shows an informative message about the version of Python we are using and then shows the prompt:

The prompt is the character string >>> that appears on the last line. The prompt indicates that the Python interpreter expects us to enter an order using the keyboard

Our first program

print("Hello World")

This is an example of the instruction * print *, it is responsible to print a value on the screen. In this case the result is the words * Hello world *.

The quotes mark the beginning and end of the value, they do not appear in the result.

  • The print statement can be delimited either by double quotes (") or by single quotes ('):
print('Hello World')

  • Another function of the print instruction is to generate a blank line, writing an order print () without arguments
print()



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Your contribution cannot be approved because it does not follow the Utopian Rules.

  • The tutorial doesn't cover a technical aspect of Python, it's simply short introduction/definition of programming and installation and
    very basic usage of Python. These are not considered as technical aspects of Python, so the contribution cannot be approved.

You can contact us on Discord.
[utopian-moderator]

Congratulations @vidayaventura! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of posts published

Click on any badge to view your own Board of Honor on SteemitBoard.

To support your work, I also upvoted your post!
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!