-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcalculation.py
More file actions
71 lines (47 loc) · 1.01 KB
/
calculation.py
File metadata and controls
71 lines (47 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
x = 1
def f():
x = 2
return x
print(x)
print(f())
print(x)
def fxy(f, x, y):
return f(x) + f(y)
cube = lambda x: x ** 3
print(fxy(cube, 2, 3))
outside = 5
def square():
global outside
outside = outside + 5
return outside
square()
print(outside)
print(outside)
x = 2
y = 4
if x == 1:
print(x)
else:
var = (y)
print(type(var))
print(++x)
print(y)
names = ["a", "b", "c"]
values = [1, 2, 3]
for x in zip(names, values):
print(x[0])
def someFuction(param1, param2 = "hello"):
if not param1:
return
return param1, param2,0
touple = someFuction(param2 ='Test', param1='data2')
print(type(someFuction(param2 ='Test', param1='data')))
print(touple[0:2] )
def student(firstname, lastname='Mark', standard='Fifth'):
print(firstname, lastname, 'studies in', standard, 'Standard')
# 1 keyword argument
student(firstname='John')
# 2 keyword arguments
student(firstname='John', standard='Seventh')
# 2 keyword arguments
student(lastname='Gates', firstname='John')