Created
September 14, 2016 07:58
-
-
Save nalakawula/4de962de293de37f0aad103090a919ba to your computer and use it in GitHub Desktop.
Kode untuk split string setiap x karakter di python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var_1 = "saya sedang belajar untuk menjadi guru profesional" | |
def split_string(string, length): | |
return (string[0+i:length+i] for i in range(0, len(string), length)) | |
def buat_list(data, z): | |
return list(split_string(data, z)) | |
hasil = buat_list(var_1, 16) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment