ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
Extra spaces not needed: print(name[::-1]) would work too.
on most exams we are prohibited from using slicing or any other build-in functions 😔
string = "codewithsekar"rev_str = ""for i in range(len(string)-1, -1, -1): rev_str += string[i]print(rev_str)rakeshtiwedoc
oldname = ’codewithsekar’name = oldname[::-1]print(name)
Extra spaces not needed: print(name[::-1]) would work too.
on most exams we are prohibited from using slicing or any other build-in functions 😔
string = "codewithsekar"
rev_str = ""
for i in range(len(string)-1, -1, -1):
rev_str += string[i]
print(rev_str)
rakeshtiwedoc
oldname = ’codewithsekar’
name = oldname[::-1]
print(name)