Bài 6

Run Settings
LanguagePython
Language Version
Run Command
#Khoi tao s truoc s = 'asfdasfwefewfwfqwhifsadfsafcoijfocwogheqqciwhoqwqwocfqwirjwicjwfcjwoifcmqwofmqcwoeghwogocwogjfgdjgkdlgdmsvmvxsafdkaecjf' min = 0 khoitaomin = False maxchar ='' max = 0 minchar ='' """ Thuat toan su dung vong lap for: buoc 1: su dung count de tinh xem cai nao lon nhat roi gan vao max cung voi max word buoc 2: min tuong tu voi max """ for word in s: count = s.count(word) if(khoitaomin == False): min = count khoitaomin = True if(count > max): max = count maxchar = word if(count < min): min = count minchar = word print("Ky tu max: %c So luong: %d" % (maxchar,max)) print("KY tu min: %c So luong: %d" % (minchar,min))
Editor Settings
Theme
Key bindings
Full width
Lines