Web Development.
Graphical User Interfaces
Internet scripting.
Embedded scripting.
Database access and programming.
Game programming.
Python program prints Hello, world!
print('Hello, world!')
OUTPUT:
Hello, world!
Pythoncaneasilyguessthatthisprogramaddstwo
numbersandprintsit.
a = 2
b = 3
sum = a + b
print(sum)
Python program to find square root:
#!/usr/bin/python import math -//import mathmodule
print "math.sqrt(100) : ", math.sqrt(100)
print "math.sqrt(7) : ", math.sqrt(7)
When we run above program, it produces following result:
math.sqrt(100) : 10.0
math.sqrt(7) : 2.64575131106
import fractions a=int(input("Enter the first number:"))
b=int(input("Enter the second number:"))
print("The GCD of the two numbers is",fractions.gcd(a,b))
Enter the first number:15
Enter the second number:5
The GCD of the two numbers is 5