-
Notifications
You must be signed in to change notification settings - Fork 0
Functions Module
from zcscommonlib import functionsTakes an input of an integer and returns a string of the month of that number.
num (int): The number of the month.
The month's name in string format.
# Imports
from zcscommonlib import functions
# Main program logic
month = functions.month(5)
print(month)
# Output: MayGets the input from a user, persisting until the input of the right type is received with an optional input message and error message.
typein (str): The type of input to require of the user (int, float, str, bool).
inputmsg (str): The message to display to the user when getting input.
errormsg (str): The error to log to console when an input of the wrong type is given.
The input provided from the user in the desired format.
Takes an array and returns a random value from it.
array (list): An array to retrieve the value from.
A random value from the array
# Imports
from zcscommonlib import functions
# Main program logic
myArray = ['value1', 'value2', 'value3']
randomArrayValue = functions.random_value(myArray)
print(randomArrayValue)
# Output: value2Software by Zandercraft. Thank you for using the ZCS Common Library!