-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathintroduction.py
More file actions
60 lines (42 loc) · 911 Bytes
/
introduction.py
File metadata and controls
60 lines (42 loc) · 911 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
#variables
print(2+3)
x=y=z=50
print(x,y,z)
d,e,f=15,100,25
print (d)
print (e)
print (f)
#t = 12345, 54321, 'hello!'
#print(t)
savings = 100
factor = 1.1
result = savings * factor ** 7
print(result)
#int,float,str,bool
name='Harsh'
male=True
print(name)
print(male)
print(type(savings))
print(type(factor))
print(type(name))
a = 100
b = 1.1
sent = "compound interest"
pro = a * b
print(type(pro))
doubledsent= sent + sent
print(doubledsent)
#type conversion
x = 100
r = 100 * 1.10 ** 7
#print("value of x is" +x+ " and r is " + r + ". got it!")
print("value of x is" + str(x) + " and r is " + str(r) + ". got it!")
pi_string = "3.1415926"
pi_float=float(pi_string)
print(type(pi_string))
print(type(pi_float))
#question
print("I can add integers, like " + str(5) + " to strings.")
#print("The correct answer to this multiple choice exercise is answer number " + 2)
print(True + False)