Skip to content

Commit e84ebad

Browse files
committed
python basic
0 parents  commit e84ebad

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

01_intro_to_strings.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name = "Zohaib"
2+
3+
c= 'ABCDEFGHIJKLMNO'
4+
5+
6+
print(c[1:5:2])
7+
8+
print(name[0:6])
9+
10+
print(name[:6])
11+
12+
print(name[0:])

str_function.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
myname = "zohaib"
2+
3+
4+
result = myname.endswith("aib")
5+
6+
result1 = myname.startswith("Zoh")
7+
8+
result3 = myname.capitalize()
9+
10+
11+
a = "Harry is a Good Boy\nBut Not A Bad \"Boy\""
12+
13+
14+
print(result,result1,result3)
15+
16+
print(a)
17+
18+
print("Tab\tSpace") # Tab
19+
print("Backslash: \\") # Backslash

0 commit comments

Comments
 (0)