Operator Penugasan
1. >>> X=3
>>>X*=670
>>>X
2010
2. >>>X=67
>>>X+=34
>>>X
101
3. >>>X=679
>>>X-=-65
>>>X
744
4. >>>X=80
>>>X/=2
>>>X
40
Operator Aritmatika
1. A= 22+55
A
77
2. B=55-22
B
33
3. C=55*22
C
1210
Mengambil Karakter dari suatu tulisan
1. >>> Nama = “Lina Ayu Sari Dewi”
>>>len (Nama)
18
2. >>>Nama = “Lina Ayu Sari Dewi”
>>>Nama [7:15]
‘U Sari Dewi’
3. >>>Nama = “Lina Ayu Sari Dewi”
>>>Nama[2:4]
‘na’
4. >>>Ran =”Sunaryo”
>>>Ran[3:7]
>>>’Aryo’
Operator Perbandingan
1. >>>55>=22
True
2. >>>55<=22
False
Tidak ada komentar:
Posting Komentar