Professional Documents
Culture Documents
Python Task Notes
Python Task Notes
SATHISH KUMAR
MOBILE=8522889387
SOLUTIONS
1)
print(letter.split(' ')[2])
l = letter.replace("a","A")
print(l)
OUTPUT
printing clouds
2)
k = ['skin','will','high','keen']
for i in k:
if 'n' in i:
print(i)
OUTPUT
skin
keen
3)
char ='a'
count = 0
for j in lettr:
if j == char:
count+=1
print(count)
OUTPUT
4)
k = ['q','w','g','u','o','d']
o = k[-3:-2]
print (o)
OUTPUT
['u']
5)
s = 'civic'
str1 =s[::-1]
if str1 == s:
print('is a palindrome')
else:
OUTPUT
is a palindrome
6)
thisdict = {
"brand": "Ford",
"electric": False,
"year": 1964,
thisdict['colors'][1] = 'Yellow'
thisdict['place'] = 'Hyderabad'
print(thisdict)
OUTPUT
{'brand': 'Ford', 'electric': False, 'year': 1964, 'colors': ['red', 'Yellow', 'blue'], 'place': 'Hyderabad'}