CBSE COMPUTER SCIENCE
Open in Telegram
QUESTION BANK, REFERENCE BOOK, LAB MANUAL , WORKSHEET ETC., PYTHON TEXT BOOK AND REFERENCE BOOKS, 01. ASK QUESTIONS AT https://t.me/joinchat/FJ1noGs-64I0OWI1
Show more549
Subscribers
No data24 hours
No data7 days
No data30 days
Posts Archive
Length of the given string : 21
1: Welcome to My COunTrY
2: Welcome to My COunTrY
3: Welcome to My COunTrY
4: Welcome to My COunTrY
5: Welcome to My COunTrY
6: YrTnuOC yM ot emocleW
7: YrTnuOC yM ot emocleW
8: YrTnuOC yM ot emocle
9: Y
10:
11: YrTnuOC
12: m
13:
14: uOC yM ot em
15:
16: m
17:
18:
19:
20: uMe
#String Slicing
S="Welcome to My COunTrY"
L=len(S)
print('Length of the given string : ',L)
print("1: ",S[::])
print("2: ",S[::1])
print("3: ",S[0::])
print("4: ",S[:21:])
print("5: ",S[0:21:])
print("6: ",S[::-1])
print("7: ",S[-1::-1])
print("8: ",S[-1:-21:-1])
print("9: ",S[-1::])
print("10: ",S[-5:-7:])
print("11: ",S[:-9:-1])
print("12: ",S[5:-17:-1])
print("13: ",S[-5:17:-1])
print("14: ",S[-5:-17:-1])
print("15: ",S[-15:-7:-1])
print("16: ",S[5:-17:-2])
print("17: ",S[-5:17:-3])
print("18: ",S[-5:-17:2])
print("19: ",S[-15:-7:-5])
print("20: ",S[-5:-18:-5])
numbers = {}
letters = {}
comb = {}
numbers[1] = 56
numbers[3] = 7
letters[4] = "B"
comb["Numbers"] = numbers
comb["Letters"] = letters
print(comb)
output:
{'Numbers': {1: 56, 3: 7}, 'Letters': {4: 'B'}}
CBSE_Lesson_plan_all_subjects_for_9th_to_12th_Classes_And_Many_More.pdf1.93 KB
