GazEcc GazEcc - 2 years ago 132
Python Question

Calling formatting in python to conjugate verbs

I'm trying to get a print of the verb to be in English conjugated by python

My code is:

verbFormat = ["I","you","he","she","we","they","yee",]
verbConjBePresent = [{0} + "am", {1} "are", {2} "is", {3} "is", {4} "are", {5} "are", {6} "are",]

I have tried adding {x} + "str" in the vCBP and tried without.

I have tried using tuples instead of lists

EDIT: The Reason I want to use the list "verbFormat" is so I don't need to re-itterate those words every time I change verb (and it should cover most tenses for most verbs)

Answer Source

Your string formatting is wrong. You're trying to format a list.

verbFormat = ["I","you","he","she","we","they","yee"]
verbConjBePresent = "{0} am;{1} are;{2} is;{3} is;{4} are;{5} are;{6} are"

With the split(';') you will print a list with conjugations. If you want all together in a string, just remove split.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download