-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring_function.py
More file actions
47 lines (41 loc) · 968 Bytes
/
string_function.py
File metadata and controls
47 lines (41 loc) · 968 Bytes
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
# name = 'Hassan AshrAf'
# print(name)
# print(name.upper())
# print(name.upper)
# print(name.lower())
# print(name.title())
# new_name = name.upper() #make copies and then make change
# print(new_name)
# print(name.capitalize())
# print(name.swapcase())
# print(name.center(20 , '-'))
# print(name.center(16 , '8'))
# print(name.center(100 , '.'))
# print(name.count('A'))
# print(name.endswith('Af'))
# name = 'Hassan \t Ashraf'
# print(name.expandtabs(20))
# print(name.index('a'))
# print(name.find('a'))
# print(name.find('z'))
# print('_'.join(name))
# name1 = "Hassan "
# li = list(name1)
# name2 = "".join(li)
# print(li)
# print(name2)
name = 'Hassan'
li = list(name)
print(li)
li.pop()
print(li)
my_string = "".join(li)
print(my_string)
# year = int(input())
# if year % 4 == 0:
# if year % 100 == 0:
# if year % 400 == 0:
# if year % 600 == 0:
# print("leap year")
# else:
# print("not leap year")