There was an error while loading. Please reload this page.
1 parent 55cb751 commit 0734f38Copy full SHA for 0734f38
exercises/16-Random-Colors-Loop/solution.hide.py
@@ -1,16 +1,17 @@
1
import random
2
3
def get_color(color_number=4):
4
- # making sure is a number and not a string
+ # Making sure is a number and not a string
5
color_number = int(color_number)
6
7
- switcher={
+ switcher = {
8
0:'red',
9
1:'yellow',
10
2:'blue',
11
3:'green',
12
4:'black'
13
}
14
+
15
return switcher.get(color_number,"Invalid Color Number")
16
17
# ❌ ⬆ DON'T CHANGE THE CODE ABOVE ⬆ ❌
@@ -25,4 +26,4 @@ def get_allStudentColors():
25
26
return students_array
27
28
-print(get_allStudentColors())
29
+print(get_allStudentColors())
0 commit comments