Skip to content Skip to sidebar Skip to footer

Python 3.4 TypeError: Input Expected At Most 1 Arguments, Got 3

Just to say I know this question has been answered before, but I'm finding it hard to apply it to my situation. cake = ('Chocolate Cakes') cake_amnt = int(input('How many',cake,'w

Solution 1:

input takes only a single string, so to concatenate instead of

cake_amnt = int(input('How many',cake,'would you like to make?'))

You should use format to build the string

cake_amnt = int(input('How many {} would you like to make?'.format(cake)))

Or use the + operator to perform concatenation

cake_amnt = int(input('How many ' + cake + ' would you like to make?'))

Post a Comment for "Python 3.4 TypeError: Input Expected At Most 1 Arguments, Got 3"