Loading...
Engaged employer
How do you initialize a list of 20 empty strings in Python.
Anonymous
x = ["" for x in range(20)]
I answered with: empties = [] for i in range(20): empties.append("") They were looking for: empties = [""] * 20
Check out your Company Bowl for anonymous work chats.
Get actionable career advice tailored to you by joining more bowls.
Stay ahead in opportunities and insider tips by following your dream companies.
Get personalised job recommendations and updates by starting your searches.