Boolean

You might also like

You are on page 1of 2

Boolean

'''name='Chidrupa\'s'

Name="murthy"

a=b=c='chinna'
Address='H no : 84, \t Phase 1, \t KPHB Hyd'

sent=r'my great\time'
print()

print('Hi Friend\'s')
print(Address)

C h i d r u p a (length 8)
0 1 2 3 4 5 6 7 --> index

#print(len(a))

for x in name :
print(x)

my_sentence='Go to Bed early or at least by 9pm'

if "bed" not in my_sentence:


print("Shutting down")

print(my_sentence[:-10])
print(my_sentence[:len(my_sentence)-10])

print(my_sentence.upper())
print(my_sentence.lower())
print(my_sentence.strip())
print(my_sentence.replace("e","a"))
print(Address)
print(Address.split(","))
print(name.center(9,"."))
print(my_sentence.isalpha())
#format
count=0
for x in my_sentence:
if x.isdigit():
count=count+1
print("Length of the string is "+str(len(my_sentence)))
print("count is "+str(count))
age=43
print("Age of person is "+str(age))

print("testing"+str('Chidrupa'.isalpha()))

quantity = 3
itemno = 567
price = 49.95
myorder = "I want to pay {} dollars for {} pieces of item {}."
print(myorder.format(price,quantity,itemno))

myorder = "I want to pay 567 dollars for 49.95 pieces of item 3."
print(myorder.format(price,quantity,itemno))

my_str='India is my country. India is beautiful. All Indians are great'


my_word='India'
print(my_str.count(my_word))
'''

print(1<2)
print(bool(10))
#= is assignment operator
#== comparision operator

You might also like