- or download this
lanx@nc10-ubuntu:~$ python
Python 2.5.2 (r252:60911, Jan 20 2010, 23:16:55)
...
...
>>> str+="4"
>>> str
'1234'
- or download this
DB<1> $str="";$t=time;for (1..100000) {$str=$str."a"."b"};print time
+-$t
13
DB<2> $str="";$t=time;for (1..1000000) {$str.="a";$str.="b"};print t
+ime-$t
1
- or download this
>>> for i in range(1, 1000000):
... str+="a"+"b"
...
>>> for i in range(1, 100000):
... str=str+"a"+"b"
...
- or download this
DB<1> $t=time;for (1..10000000) {$str="";$str.="a"."b";};print time-
+$t
10
...
17
DB<3> $t=time;for (1..10000000) {$str="";$str=$str."a"."b";};print t
+ime-$t
15