How to make matrices in Python?

前端 未结 6 1205
闹比i
闹比i 2020-12-31 20:23

I\'ve googled it and searched StackOverflow and YouTube.. I just can\'t get matrices in Python to click in my head. Can someone please help me? I\'m just trying to create a

6条回答
  •  南笙
    南笙 (楼主)
    2020-12-31 21:08

    you can also use append function

    b = [ ]
    
    for x in range(0, 5):
        b.append(["O"] * 5)
    
    def print_b(b):
        for row in b:
            print " ".join(row)
    

提交回复
热议问题