I just started studying UDF's and I can't get my code to work and I am unsure what I did wrong, anyone know how to fix this?
I am getting this error line 55, in main() TypeError: main() missing 3 required positional arguments: 'word1', 'word2', and 'word3'
my code looks like this
import random
def get_determiner(amount):
if amount == 1:
determiner = ['a', 'one', 'the']
else:
determiner = ['those', 'some', 'many', 'the']
word1 = random.choice(determiner)
return word1
def get_noun(amount):
if amount == 1:
noun = ["bird", "boy", "car", "cat", "child",
"dog", "girl", "man", "rabbit", "woman"]
else:
noun = ["birds", "boys", "cars", "cats", "children",
"dogs", "girls", "men", "rabbits", "women"]
word2 = random.choice(noun)
return word2
def get_verb(amount, tense):
if tense == 'past':
verb = ["drank", "ate", "grew", "laughed", "thought",
"ran", "slept", "talked", "walked", "wrote"]
elif tense == 'past' and amount == 1:
verb = ["drinks", "eats", "grows", "laughs", "thinks",
"runs", "sleeps", "talks", "walks", "writes"]
elif tense == 'past' and amount != 1:
verb =["drink", "eat", "grow", "laugh", "think",
"run", "sleep", "talk", "walk", "write"]
elif tense == 'future':
verb =["will drink", "will eat", "will grow", "will laugh",
"will think", "will run", "will sleep", "will talk",
"will walk", "will write"]
word3 = random.choice(verb)
return word3
def main():
get_determiner(word1)
get_noun(word2)
get_verb(word3)
amount = input('how many things are there? ')
tense = input('Past, present or future? ')
first = word1.capitalize()
print(f'{first} {word2} {word3}')
main()