-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3.6-Functions.py
More file actions
28 lines (23 loc) · 889 Bytes
/
Copy path3.6-Functions.py
File metadata and controls
28 lines (23 loc) · 889 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
# Functions
# Defining a function
def student_scores(English, German, Spanish, French):
print 'My score in English is %d:' % English
print 'My score in German is %d:' % German
print 'My score in Spanish is %d:' % Spanish
print 'My score in French is %d:' % French
# Scores given to function directly
print 'Scores given directly to student_scores function:'
student_scores(70, 83, 92, 73)
# Scores given to function using variables
print 'Scores given using variables:'
score_1 = 70
score_2 = 83
score_3 = 92
score_4 = 73
student_scores(score_1, score_2, score_3, score_4)
# Scores added and given to function
print 'Scores given by adding assignment scores:'
student_scores(65 + 5, 80 + 3, 90 + 2, 70 + 3)
# Scores added to varilable values and given to function
print 'Scores added to values in variables'
student_scores(score_1 + 5, score_2 + 5, score_3 + 5, score_4 + 5)