Skip to content

Instantly share code, notes, and snippets.

View prakashgd's full-sized avatar

Prakash G prakashgd

View GitHub Profile
a, b = set(raw_input("Enter Set 1: ")), set(raw_input("Enter Set 2:"))
print "Similar elements = {} ".format(a&b)
n = int(input("Enter your number"))
d = n - 1
x = 2
dvr = []
while 2 <= x <= d:
y = n % x
if y == 0:
dvr.append(x)
x += 1
else:
num = int(raw_input("Enter number: "))
if num % 2 == 0 and num % 4 != 0:
print '%d is Even number' % num
elif num % 4 == 0:
print '%s is multiples of Four' % num
else:
print '%d is odd number' % num
@prakashgd
prakashgd / Century_Calc.py
Created July 30, 2016 14:52
This program calculates at which year you will turn to 100
##Century Calculator
import datetime
name = raw_input("Enter your name:")
age = int(input("Enter your age:"))
times = int(input("How many times you want to print this message"))
now = datetime.datetime.now()
century = int((100 - age) + now.year)
print "\nHello \"%s\" you will attain 100th age in %sth year." % (name, century) * times