Introduction to Python

By: Mahgul Afzali

1)What is python programming language?

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. read more

Python Practice Examples (Part 1)

Contributed By: Alia Kashifi

Q1: Write a Python program to find the reverse of a number (without using built-in function).

E.g. 123 to 321.


print ” Reverse of a number ”

num = int(raw_input(“Enter a number: “))

reverse = 0

while num:

rem = num%10

reverse = reverse*10+rem

num = num//10;

print “reverse= “,reverse

Q2:  Write a Python program to find if  a number is Palindrome number.

Tips: A palindromic number is a number that remains the same when its digits are read more