Python Tutorials – Syntax and Basics of Python 3


Read Time1 Minute, 26 Seconds

Now as the introduction is over, let’s head towards the tutorials’ next part. Now let us see some basic data types and syntax to represent them. Note that we are covering ‘Python 3’ in this tutorial which is the latest version of Python and is here to stay.

Writing Your First Code:

Let’s start in a very easy way. We will just kick off with writing your name. To output any text on the screen, we do use print statement in python.

Syntax:

Now let’s take this further and learn some basic operations.

Some other operations are //,** etc.

As you can see above, putting calculations directly into python shell will get you an answer.

Variables:

Declaring a variable in Python is much easier than you thought. If you have to declare an integer, simply declare as follows.

a=6

To print the value of that variable a, just like above enter this code: print(a)

For float, b=6.1

To print: print(b)

For declaring string, c=”shubham”

To print: print(c)

Note: Strings can be concatenated using ‘+’ operator.

Also, note that you can assign any value to the same variable at any time. As the declared variable doesn’t have a specific type.

Editors for Python: 

As you can see we have posted screenshots of Python Shell, which is installed on Windows. Python can also be used in a simple text editor in Linux. Or you may consider installing some IDEs (Integrated Development Environment).

Now if we have to give you options, take a look at this list (These are Not ordered by any special criteria) :

  • Eclipse
    • Use Pydev plugin
  • Pycharm
  • Komodo IDE
  • Spyder
  • Python-IDLE
  • Geany
  • Pyscripter
  • Eric
  • Wing IDE
  • Netbeans
  • Vim IDE

This is it, for now, more coming in next posts.


Shubham

Shubham is an ambitious coder. He mostly writes about cloud computing and upcoming technical gadgets. He has widely influenced by the technological world and love to express his judicial opinion on happening activities. And yes he's massive Liverpool Fan.

Leave a Reply

avatar
  Subscribe  
Notify of