Status: Started
Objective
In this exercise, you are given a number between 2 and 12. You should return the number of possible two dice combinations that can roll that combo. For example, if given 4, you would return 3 since you could roll a 1 and 3, 2 and 2, or 3 and 1.
Example:
- scratchpad.py
- Unit Test
Font Size
14
Parentheses autocomplete
Wrap lines
Editor
Theme
Code with blocks by default
Console Font Size
12
Console Theme
Display Server Graphics Screen
Show File Tab Bar
Debug Mode
Dice combinations
Unit Test
1
2
def dice_combo(target):
# Enter your code here
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output
Grading
Docs
Exercise
More
History
Video
Download
About
W
Test Cases
x/x
Pass | Test | Message | |
---|---|---|---|
- | Test results will show here. | - |
Errors:
This student is viewing this assignment in English. View this page in English?
5 points
In this exercise, you are given a number between 2 and 12. You should return the number of possible two dice combinations that can roll that combo. For example, if given 4, you would return 3 since you could roll a 1 and 3, 2 and 2, or 3 and 1.
Example:
dice_combo(4) --> 3
dice_combo(7) --> 6
Reset Code
Upload an image
Upload from your computer
Or paste a link here
Slides and Notes
No slides available for this video
About
Python 3 Practice
3.11.9 (default, Apr 6 2024, 17:59:24)
[GCC 6.4.0]