tests/string.py | raw changeset files shortlog |
1.1 --- a/tests/string.py Sat Jan 28 13:27:31 2017 +0100 1.2 +++ b/tests/string.py Sat Jan 28 22:37:41 2017 +0100 1.3 @@ -64,3 +64,15 @@ 1.4 print hash(s4) 1.5 print "# hash(s5):", 1.6 print hash(s5) 1.7 + 1.8 +# Test multiplication of strings. 1.9 + 1.10 +s6 = "abc" 1.11 +print s6 * -1 # 1.12 +print s6 * 0 # 1.13 +print s6 * 1 # abc 1.14 +print s6 * 2 # abcabc 1.15 +print -1 * s6 # 1.16 +print 0 * s6 # 1.17 +print 1 * s6 # abc 1.18 +print 2 * s6 # abcabc