If I want to make a list consisting of 12 False Boolean values, is there a shortcut to do this without typing out all 12? I know that 'string ' * 3 returns 'string string string'. But True * 3 just returns 3.
You need to put whatever you're repeating in an array, and then multiply by an integer to get repeating sequence.
x = [False] * 12 should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With