I am trying to find a way to make two lists the same length. How can I add zeros to one list so as to make it have the same length with the first one?
i.e. list1=[ 1 2 3 4 5]; list2=[ 1 2 3]
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.
There are many ways you can do that. One of them is
Another way is
Both of these ways assume that
list2is shorter thanlist1.