Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

NAME =N.

SATHISH KUMAR

MOBILE=8522889387

SOLUTIONS

1)

letter = 'sky have clouds and birds'

print(letter.split(' ')[2])

l = letter.replace("a","A")

print(l)

OUTPUT

printing clouds

sky hAve clouds And birds

2)

k = ['skin','will','high','keen']

for i in k:

if 'n' in i:

print(i)

OUTPUT

skin

keen
3)

lettr = 'python is a easy programming language'

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:

print('is not a palindrome')

OUTPUT

is a palindrome

6)

thisdict = {

"brand": "Ford",

"electric": False,

"year": 1964,

"colors": ["red", "white", "blue"]}

thisdict['colors'][1] = 'Yellow'

thisdict['place'] = 'Hyderabad'

print(thisdict)

OUTPUT

{'brand': 'Ford', 'electric': False, 'year': 1964, 'colors': ['red', 'Yellow', 'blue'], 'place': 'Hyderabad'}

You might also like