-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice_general.py
More file actions
78 lines (61 loc) · 1.01 KB
/
practice_general.py
File metadata and controls
78 lines (61 loc) · 1.01 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
a= 1
b="2"
c=2.3
d=9.45667
print(type(a),a)
print(type(b),b)
print(type(c),c)
print(type(d),d)
x="8"
print(type(x),x)
x=float(x)
print(type(x),x)
for x in "banana":
print(x)
y=7
print(x,y)
x = "HELLO,WORLD"
print(type(len(x)),x)
txt = "The best things in life are free!"
print("frees" in txt)
str = "Present the name safwan"
if "ahmad" not in str:
print("yes , safwan is presnt ")
x = " hello, world !"
#print(x[-5:-3])
print(x.upper())
print(x.lower())
print(x.strip())
print(x.replace("h","E"))
print(x.split(","))
from os import fchdir
a = "Hello"
b = "World"
c = a +" "+ b
x= 8
y=10
e= "12"
f="13"
e = int(e)
f = int(f)
print(e)
print(f)
g=e+f
d=x+y
print(g)
print(d)
print(c)
age = "36"
txt = "My name is John, I am " + age
print(txt)
age = 36
txt = "My name is John, and I am {}"
print(txt.format(age))
name = "safwan"
str = " ahamad"
price = 786
quantity= 55
info = "my name is {} with name {} having money {} of quantity {} "
print(info.format(name,str,price,quantity))
x = 'hello'
print(x[2])