Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pick-color/main.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Color Picker Simulator
# Picks a random color from a predefined list

import random
from random import randrange

def get_random_color():
# TODO: Return a random color from the list
colors = ["Red", "Green", "Blue", "Yellow", "Purple", "Orange"]
print(colors[randrange(5)])
pass

def main():
Expand All @@ -14,6 +15,6 @@ def main():
while True:
input("Press Enter to pick a color (or Ctrl+C to quit)...")
# Call the random color function and display the result

print(get_random_color())
if __name__ == "__main__":
main()