Python: String Operation
Contents 1 Strip /n 2 Hitung banyak word 3 Join Line 4 Remove specific line 5 Percobaan 6 Frequency word 7 Frequency word Strip /n line.strip() - remove all types of whitespaces from both ends of the line. line.rstrip("\n") remove only the trailing "\n". Hitung banyak word len(string.split()) Join Line Pakai str.join: with open('file.txt') as f: print " ".join(line.strip() for line in f) Remove
| Penerbit | Taratsa |
|---|---|
| Tahun | 2017-01-29 |
| Bahasa | ind |
| Pengenal | bookid: urn:uuid:0342e3ac-88c5-5cec-b1b3-d6981a9f8767 |