How can I create a list which contains only zeros? I want to be able to create a zeros list for each int in range(10)
For example, if the int in the range was 4 I will get:
[0,0,0,0]
and for 7:
[0,0,0,0,0,0,0]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if you prefer to put it in the function, just drop in that code and add
return listofzerosWhich would look like this:
sample output: