forked from mAhmedSiddiki/Python_Full_Course
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07_string.py
More file actions
92 lines (49 loc) · 1021 Bytes
/
07_string.py
File metadata and controls
92 lines (49 loc) · 1021 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
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
# -*- coding: utf-8 -*-
a = 'codinglaugh'
b = "codinglaugh"
print(a,type(a))
print(b,type(b))
c = "youtube channel name is 'codinglaugh'"
print(c)
d = '''codinglaugh
learn
something
everyday'''
print(d,type(d))
e = 'codinglaugh '
f = "learn "
g = "something "
h = "everyday "
# print(e+f+g+h+"marjuk")
print(e*5)
print("c" not in e)
print(len(e))
length = 0
for i in e:
print(i,end="")
length += 1
print()
print(length)
h = "codinglaugh"
if "codingdshflaugh" != h:
print("matched")
else:
print("something wrong")
i = "abc"
j = "ABC"
print(i>j)
# print(e[-12])
# print(e[:])
# e = e[:3]+"m"+e[4:]
# e = e[:3]+""+e[4:]
# del e[3]
print(e)
# =============================================================================
# String format()
# =============================================================================
a = "codinglaughsdh"
b = 4
c = 3.4534758
# d = a + " {1} {0:.3f}".format(c,b)
d = "{0:$>20} {1} {0} marjuk".format(a,"jsdbf")
print(d)