def random_sentence(sentence_len, words): ''' Select a random set of words from words file and store in a data type Put the number of words requested together into a "sentence" Output sentence ''' sentence = "" for _ in range(sentence_len): word = random_python_quote(words) sentence += word + " " return sentence
from python_quote import random_python_quote ran_quote = random_python_quote() print(ran_quote)
def import_quote(): quotes = python_quote.random_python_quote() return quotes
import python_quote as quote if __name__ == '__main__': quote = quote.random_python_quote() print(quote)
from python_quote import random_python_quote print(random_python_quote())
import python_quote quotes = python_quote.random_python_quote() print(quotes) # print(__name__)
import python_quote print(python_quote.random_python_quote())
def random_sentence(sentence_len, words): sentence = "" for _ in range(sentence_len): word = random_python_quote(words) sentence += word + " " return sentence
from python_quote import random_python_quote quotes = ["It's just a flesh wound.", "He's not the Messiah. He's a very naughty boy!", "THIS IS AN EX-PARROT!!"] print(random_python_quote(quotes))
from python_quote import random_python_quote if __name__ == '__main__': random_python_quote()
def import_quote(): quote = python_quote.random_python_quote() print(quote)
def random_sentence(sentence_length, words): new_sentence = "" for _ in range(sentence_length): word = random_python_quote(quotes) new_sentence += word + " " return new_sentence
def random_python_quote(): return random_python_quote()