Python Python Basics (2015) Logic in Python Print "hi"

Dolapo Sekoni
Dolapo Sekoni
Pro Student 1,431 Points

please assist with this
def printer(count):
    print("Hi" * {}.format(count))


1 Answer

Robert Ionut Muraru
Robert Ionut Muraru
5,294 Points

Hello. You don't need to add the .format part in your code, that works for strings and in this case Python thinks it has to do with a dictionary due to the {} which is outside the quotation marks. To fix it, multiply the string by the argument directly.