-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
91 lines (57 loc) · 1.66 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# name = "Soumadip"
# print(len(name)) # In range, counting starts from 1
# print(name[0:7:2])
# # [ start: End: Jump index]
# print(name[-1])
# String Methods
# range starts from 1 to ...
# index starts from 0
# string slicing starts from o to range -1
# negative index starts from -1 to rahge
# So range and negative is same but opposite
# import datetime
# name = input("Enter your name: ")
# date = datetime.datetime.now()
# letter = f'''
# Dear {name},
# You are selected!
# {date}
# '''
# print(letter)
# def detect_double_space(string):
# if string.find(" ") != -1:
# print(string.replace(" ", " "))
# print(string.find(" "))
# elif(string.find(" ") == -1):
# print("Bhooya")
# print(string.find(" "))
# else:
# return
# detect_double_space(input("Enter your name\nDouble spaces will be replaced with one.\n=> "))
# print("i am a boy who is \"Terrificly terrified\"")
# print("i am a boy\\google employee.")
# friends = [ "alpple", "google", 5, ["google", 48]]
# print(friends[3])
# friends[3] = 50000
# print(friends)
# friends2 = [10, 11, 2000 ]
# friends2.sort(reverse=True)
# print(friends2)
# print(friends.index("alpple"))
# input("I am google employee:")
# print("google.com")
# for i in range(10):
# print(i)
my_string = "Soumadip Das "
print(my_string.lower())
print(my_string.upper())
print(my_string.split("-")[0])
print(my_string.strip())
print(my_string.replace("-", " "))
print(my_string.find("Das"))
print(my_string.isalpha())
print(my_string.isdigit())
print(my_string.startswith("Hello"))
print(my_string.isalnum())
print(my_string.endswith(" "))
print(my_string.count("a"))