print "Menu"
print "====="
print "A. Order"
print "B. Invoice"
print "C. Warehouse"
print "D. Finance"
cSel = raw_input("Select: ")
if cSel=='A' :
print "You Selected Order"
elif cSel=='B' :
print "You Selected Invoice"
elif cSel=='C':
print "You Selected Warehouse"
elif cSel=='D' :
print "You Selected Finance"
else :
print "Erroneous Choice"
import sys
cSal = 'A'
while cSal!='X':
print "Menu"
print "====="
print "A. Order"
print "B. Invoice"
print "C. Warehouse"
print "D. Finance"
print "X. Exit"
cSel = raw_input("Select: ")
if cSel=='A' :
print "You Selected Order"
elif cSel=='B' :
print "You Selected Invoice"
elif cSel=='C':
print "You Selected Warehouse"
elif cSel=='D' :
print "You Selected Finance"
elif cSel=='X':
sys.exit()
else :
print "Erroneous Choice"
x = 'X'
blank = ' '
for i in range(10, -1, -1):
for j in range(i):
print blank,
print x,
for j in range(10-i):
print x, x,
print ''
for i in range(2):
for j in range(10):
print blank,
print x
import sys
cName = raw_input("Enter your name: ")
print "Your name is " , cName
print "Your name is " , len(cName), " Characters long"
print "Your entire string is " , sys.getsizeof(cName), " characters long"
cName=range(30)
cName = raw_input("Enter your name in lower case: ")
iLen = len(cName)
for ltr in cName:
print ltr.lower(),
cName = raw_input("Enter your name: ")
iLen = len(cName)
cInt = []
cInt.append(cName[0])
for i in range(1, iLen):
if cName[i] == ' ':
cInt.append(cName[i+1])
print "Your Initials are ", ''.join(cInt)
cName1 = raw_input("Enter a Name: ")
cName2 = raw_input("Enter another Name: ")
if cName1 > cName2 :
print cName1 , cName2
else :
print cName2 , cName1
print "Enter 5 names: "
names = []
for i in range(5):
names.append(raw_input("name " + str(i+1) + ": "))
names.sort()
for i in range(5):
print names[i]
cName = raw_input("Enter Your Name: ")
for i in range(29):
if cName[i] == ' ':
break
cFirst=cName[0:i]
print cFirst
cSur=cName[i+1:]
print cSur
cSur=cSur+" "
cSur=cSur+cFirst
print cSur
cSur=cSur[::-1]
print cSur
cEncrypt = []
cName = []
cName = raw_input("Enter Your Name: ")
iLen = len(cName)
for i in range(iLen):
asc=ord(cName[i])
asc=asc+1
cEncrypt.append(chr(asc))
print ''.join(cEncrypt)
import random
iLen = random.randint(0,100)%3+5
cPw=[]
for i in range(iLen):
val=random.randint(0,122)%26+65
cPw.append(chr(val))
print ''.join(cPw)
cText=[]
cEncrypt=[]
cTemp1=[]
cText=raw_input("\nWrite a text in upper case: ")
iLen= len(cText)
for i in range(iLen):
print cText[i]
car=ord(cText[i])
cEncrypt.append(car)
print ''.join(str(cEncrypt))
import random
cKey="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
cKey=list(cKey)
cEncrypt=range(50)
for i in range(26):
j=random.randint(0,100)%26
cTemp=cKey[i]
cKey[i]=cKey[j]
cKey[j]=cTemp
cKey="".join(map(str,cKey))
cText=raw_input("\nWrite a text in upper case: ")
iLen= len(cText)
for i in range(iLen):
cEncrypt[i]=cKey[ord(cText[i])-65]
cEncrypt=cEncrypt[::iLen]
print "".join(map(str,cEncrypt))