forked from Techsrijan/summer2025
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringexplore.py
More file actions
55 lines (44 loc) · 1.1 KB
/
stringexplore.py
File metadata and controls
55 lines (44 loc) · 1.1 KB
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
a=155454/646
print(format(a,'.2f'))
st="welcome to Python tutorial"
print(st,type(st))
print("no of character=",len(st))
print(st.capitalize())
print(st.upper())
print(st.lower())
print(st.swapcase())
print(st.title())
print(st.count('w'))
# name=input("enter your name")
# if name.isalpha():
# print(name)
# else:
# print("Please enter valid name")
# age=input("enter your age")
# if age.isnumeric():
# print(age)
# else:
# print("Please enter valid age")
# roll=input("enter your board enrollemnt no")
# if roll.isalnum():
# print(roll)
# else:
# print("Please enter valid roll")
# data="her name is tamanna and tamanna is good girl"
# fdata=input("enter the string u want to replace")
# print(fdata)
# print(data.replace('tamanna',fdata))
# name=input("enter your name")
# print(name,end='')
# print('hello')
# print()
# print(name.strip('!'),'dgfg')
#print(name.lstrip(' '),'dgfg')
# print(name.rstrip(' '),'dgfg')
st1="hello how are you"
print("ends with=",st1.endswith('p'))
print(st1.split(' '))
wronginput="!!!!@4ashwani!!!"
da=wronginput.strip('!@4')
print(da)
#print(da.strip('@'))