-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphi.py
More file actions
59 lines (55 loc) · 1.29 KB
/
phi.py
File metadata and controls
59 lines (55 loc) · 1.29 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
55
print("hello")
"Hello"
x="hello"
type(x) #class strg
x=5
print(x)
type(x) #class int
x=True
type(x) #class bool True False first ltr cptl
y = "hello this is nitish"
type(y)
print(y)
y #hello this is nitish
y[0] #h
y[4] #o
y[-1] #l
y[6] #t slicing operator
y[6:10] #this cutting operator it will show str between num
y[2:4] #ll
y[1:4] #ell start from given no exclude 1 no in last
y[1:6] #ello
y[1:6:1] #ello jump 1
y[1:6:2] #el jump 2
y
y[:] #starting from last same ans
y[::1] #hello this is nitish
y[::2] #hloti svml
y="this is my data welcome you"
y
y="this is my data \n welcome you" #scape sequence
print(y) #explit line by line
y="this is my data \t welcome you" #single cote and double cote is same in python bt not in other language
print(y) #explit with space like tab
x = "this is nitish searching for"
"nitish" in x #True
"ravi" in x #False
y=2, 6, 89, "hai", 8.7
type(y) #toupe data type
name = [ "nitish", "satish", "ritesh", ] #list data type edit mutet
type(name)
name[0] #same slicing rule "nitish"
name[0:2] #nitish satish
len(name) #find how many row 3
name = [ "nitish", 1111 ,"satish", 2222 ,"ritesh", 3333 ] #added with no
len(name) #6 len
name[1] #'nitish',1111
name[1][0] # skiping ans is satish mins 1 of 0
name[2]
name[:2]
name[1:3]
name[1:3][1]
name[0]
name[0][1]
name[1][1]
name[2][1]