串列乘一數字

  1. 串列乘 2。
    pyuser@deyu:~/zzz$ cat list7.py
    #!/usr/bin/python
    
    listx = [ 'a', 'b', 'c' ]
    listx *= 2
    print("listx =", listx)
    
  2. 執行結果
    pyuser@deyu:~/zzz$ ./list7.py
    listx = ['a', 'b', 'c', 'a', 'b', 'c']