def take_info(arr2,arr, number):
arr[0] = number
name = input()
arr[1] = name
grade = int(input())
arr[2] = grade
second_grade = int(input())
arr[3] = second_grade
arr2. append(arr)
return arr2
def main():
number = int(input())
arr2 = []
while number>0:
arr = [[0] for _ in range(4)]
arr2 = take_info(arr2,arr,number)
number = int(input())
main()
take_info function must return while ' number >0 ', when the number is 0 or less than 0 loop would end. And I want to add these values and name to a list and the other list's each element should be that list. These code is working pretty well but I want to turn this code into something usefull.
Point 1 I am thinking is : how can I add that DIFFERENT Type of inputs into "arr"
Point 2 I am thinking is : When I am creating a list that like arr = [0] * 4, output gives me same value and exactly each value is the last one. Why is this happening can anybody tell me?