-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·33 lines (24 loc) · 799 Bytes
/
main.py
File metadata and controls
executable file
·33 lines (24 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# tHIS IS THE MAIN FILE PROGRAM TO SHUFFLE ITEMS
from random import *
items = []
def get_items():
""" Get items to shuffle as a list"""
print('Enter items to shuffle, one per line.\n')
print("Enter 'done' when finished.\n")
item = input("Item: ")
if item == "done":
return items
while item != "done":
items.append(item)
item = input("Item: ")
return items
def shuffle_items():
"""Shuffle items which where taken"""
print("Shuffling items...")
shuffle(items)
print('Randomly picked value: {}'.format(items[choice(range(0, len(items)))]))
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
get_items()
shuffle_items()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/