Pages

Monday, March 23, 2015

Hello Python, New Python 3 Blog

Hello, Today I have open a new blog, Python 3. Python is a high-level computer language. Scripting language is a language format that is easy to write, syntax is easy to read and use it as a foreign language program coordinator. First version was created by Guido van Rossum in 1990, I don't get what the fuss me to history.


Python 3 programming model basic.

Hello world

print ("Hello world")

Results
Hello world in Python 3

You will see that the Python 3 programming model is simple.

Simple sum program.

This program is used primarily by inherited and then using if else then show results.

#!/usr/bin/python
#-*-coding: utf-8 -*-
print ("Program + or -")
print ("Build by Wannaphong")
print ("18/10/2013")
print ("1.+ 2. -")
x = int(input("input: "))
if x == 1:
a = int(input("input1: "))
b = int(input("input2: "))
print ("=" , a + b)
elif x == 2:
c = int(input("input1: "))
d = int(input("input2: "))
print ("=" , c - d)
elif x & 1 or x & 2:
print ("No!. You input'n 1 or 2.")


Results

Simple sum program

You will see that the author of the Python 3 is easy-to-understand code if readers written C before Python 3 will find comfortable and easier. Performance on fighting C language is not.

Thank you

No comments:

Post a Comment