Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

print random string from list python

import random

list = ["Item 1", "Item 2", "Item 3"]			# List
item = random.choice(list)						# Chooses from list
print(item)					# Prints choice

# From stackoverflow
# Tried and tested method
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #print #random #string #list #python
ADD COMMENT
Topic
Name
4+9 =