-
Notifications
You must be signed in to change notification settings - Fork 0
/
variables
48 lines (37 loc) · 1.13 KB
/
variables
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
#Variables in Python
a = 10 #integer
b = 2.5678 # float
#here, a is the variable to which the int value 10 is assigned
and b is the other variable to which float value 2.5678 is assigned
#strings in python
x = "LEARN PYTHON WITH ME"
# strings are usually represented by single or double inverted commas in python
y = 'Bring the best out of you in the worst situation'
#Libraries in python
A Python library is a collection of related modules. It contains bundles of code that can be used repeatedly in different programs.
python has vast number of libraries, including
1.TensorFlow
2.Matplotlib
3.Pandas
4.Numpy
5.Scipy,etc
#LOOPS in python
There are two types of loops in Python:
1.for loops.
2.while loops.
#functions in python
function is a block of code
the syntax to declare a function is:
def function_name(arguments):
# function body
return
# PYTHON PROGRAM
def simple_interest(p,t,r):
print('The principal is', p)
print('The time period is', t)
print('The rate of interest is',r)
si = (p * t * r)/100
print('The Simple Interest is', si)
return si
# Driver code
simple_interest(8, 6, 8)