File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,9 @@ Here is one approach to building your function:
10
10
11
11
This line of code is how you can return heads:
12
12
13
- return "heads"
13
+ ``` python
14
+ return " heads"
15
+ ```
14
16
15
17
That's it! Test it out and see how many times can your program flip a coin a second.
16
18
@@ -25,12 +27,16 @@ This program uses an array named totals. An array is a variable that remembers a
25
27
26
28
This is how you can set a specific slot in the array. In this example we are setting spot 5 (remember it counts starting at zero) to be 99.
27
29
28
- totals[5] = 99
30
+ ``` python
31
+ totals[5 ] = 99
32
+ ```
29
33
30
34
This is how we can look up what the number is in a spot and print it out. This would print 99
31
35
32
- print totals[5]
33
-
36
+ ``` python
37
+ print totals[5 ]
38
+ ```
39
+
34
40
Your job is to complete the dice_roll() function. It should roll two 6-sided dice and add the rolls together. It should return their total.
35
41
36
42
That's it! Test it and see if it is faster or slower than the coin flip program.
You can’t perform that action at this time.
0 commit comments