A
A
Animkim2016-05-25 09:17:49
Python
Animkim, 2016-05-25 09:17:49

Why does formatting give an error?

add = 2
plural = u'недели'
comment =  u'Добавьте ещё %(add)s доп. %(plural)s.' % (add, plural)

format requires a mapping

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2016-05-25
@Animkim

comment = u'Add another %s extra. %s.' % (add, plural)
or
comment = u'Add more %(add)s extra. %(plural)s.' % ({'add': add, 'plural': plural})

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question