-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path10.0_String.py
More file actions
52 lines (40 loc) · 1.08 KB
/
Copy path10.0_String.py
File metadata and controls
52 lines (40 loc) · 1.08 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
#String in double qoutes and single qoutes
print("Hello sakib")
print('Hello Sakib')
#Qoutes inside qoute
print("it's Alright boy")
print("He is called 'The retake king'")
print('He is called "The retake king')
#Assign string to a variable
a = "Hello programmer"
print(a)
#Assigning multiple string to a variable
m = """Hey, myself sakib, Nazmus Sakib Shawon. I'm
Learning python from basic to advance. My target is to
Become a Data scientists or ML expert .
Let's See how far I can go"""
print(m)
m1 = '''But now the target is passing semister and
clearing my retake and having fully efficiency in python
within 10 Weeks, But InShaAllah i'll make it before
10 weeks.'''
print(m1)
#Ascessing element of string
print(a[15]) #first character is 0
#Looping through a string.
for char in a:
print(char)
for word in a.split():
print(word)
#getting word length
print(len(a))
#Checking string
print("Sakib" in a)
#Using If statement
if "programmer" in a:
print("Found it")
#Checking If Not
print("Python" not in a)
#Usinging If Not statement
if 'Python' not in a:
print("Not found")