N=10
li = raw_input("Enter %d numbers: " % N) #accepting input in list
a = map(int, li.split())
print "In reverse order: ",
for i in a[::-1]: #print reversed list
print i,
digit_seen=[False]*10 #initialise with false
n=int(raw_input("Enter a number: "))#input number
while(n>0): #calculate if any digit repeated
digit=n%10
if (digit_seen[digit]==True):
break
digit_seen[digit]=True
n=n/10
if(n>0):
print "Repeated digit" #print result
else:
print "No repeated digit"
import sys
#initialisation
value=[None]*5
NUM_RATES=int(sys.getsizeof(value)/sys.getsizeof(value[0]))-1
INITIAL_BALANCE=100.00
#accept input
low_rate=int(raw_input("Enter interest rate: "))
num_years=int(raw_input("Enter number of years: "))
print ""
#print calculated result table
print "Years",
for i in range (NUM_RATES):
print "%6d%%" % (low_rate + i),
value[i]=INITIAL_BALANCE
print ""
for year in range (num_years):
print "%3d\t"%(year+1),
for i in range (NUM_RATES):
value[i]=value[i]+ (low_rate+i)/100.0*value[i]
print "%7.2f"%value[i],
print ""
import random
#initialisation
NUM_SUITS=4
NUM_RANKS=13
in_hand = [[False for i in xrange(13)] for i in xrange(4)]
rank_code=['2','3','4','5','6','7','8','9','t','j','q','k','a']
suit_code=['c','d','h','s']
#accet input
num_cards=int(raw_input("Enter number of cards in hand: "))
print "Your hand: ",
while(num_cards>0):
suit=random.randint(0,(NUM_SUITS-1)) #generate random suit
rank=random.randint(0,(NUM_RANKS-1)) #generate random rank
if (in_hand[suit][rank]!=True):
in_hand[suit][rank]=True
num_cards=num_cards-1
#print hand
print "%c%c" % (rank_code[rank],suit_code[suit]),
print ""
n=int(raw_input("How many numbers do you want to reverse?")) #accept number of elements
li = raw_input("Enter %d numbers: " % n) #accepting input in list
a = map(int, li.split())
print "In reverse order: ", #print reversed list
for i in a[::-1]:
print i,