Sen
Sen

Reputation: 53

formatting output in python with specifier not working

print 'there are %d vowels and they are %s' % 2,'oo'

Why isn't this working? the error is about string formatting not enough arguments. I don't really understand....Plz help~

Upvotes: 0

Views: 99

Answers (1)

Malik Brahimi
Malik Brahimi

Reputation: 16711

You need an iterable to supply formatting options:

print 'there are %d vowels and they are %s' % (2,'oo')

Upvotes: 3

Related Questions