~python >>> x=10 >>> print x 10 >>> x=20 >>> print x 20
~python >>> 20+30 50 >>> s=_ >>> s 50
~python >>> range(10) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(3,6) [3,4,5] >>> for i in range(5): ... print i 1 2 3 4 5
~python >>> s=[1,2,3,4] >>> for i in s: ... print i 1 2 3 4
~python if x==0: print x else: print x+10
~python def fact(n): if n==0: return 1 return n*fact(n-1)
~cpp import Image im = Image.open("lena.gif") im.size
~cpp import Image im = Image.open("lena.gif") for x in range(256): for y in range(256): im.putpixel((x,y), im.getpixel ((x,y)) + 30 ) im.show()
~cpp import Image im = Image.open("lena.gif") for x in range(256): for y in range(256): im.putpixel((x,y), im.getpixel ((x,y)) - 30 ) im.show()