Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/asweigart/PythonStdioGames
/ getRandomColor
Function
getRandomColor
src/gamesbyexample/fishtank.py:96–99 ·
view source on GitHub ↗
Return a string of a random color.
()
Source
from the content-addressed store, hash-verified
94
95
96
def
getRandomColor():
97
""
"Return a string of a random color."
""
98
return
random.choice((
'black'
,
'red'
,
'green'
,
'yellow'
,
'blue'
,
99
'purple'
,
'cyan'
,
'white'
))
100
101
102
def
generateFish():
Callers
1
generateFish
Function · 0.85
Calls
no outgoing calls
Tested by
no test coverage detected