Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- d = [1,3,2,5,9,8,4,5,6]
- max = d[0]
- min = d[0]
- for e in d[1:]:
- if e > max:
- max = e
- for e in d[1:]:
- if e < min:
- min = e
- for all in range(len(d)-1,0,-1):
- for i in range(0,all,1):
- if d[i] > d[i+1]:
- temp = d[i]
- d[i] = d[i+1]
- d[i+1] = temp
- print(max)
- print(min)
- print("bubble sort from min to max = ",d)
- #in_txt = input("Enter digits : ")
- in_txt = "2845"
- out_txt = ""
- arabic_number = "0123456789"
- thai_number = "๐๑๒๓๔๕๖๗๘๙"
- for a in in_txt :
- k = int(a)
- if k < 0 :
- out_txt += "Negative"
- else :
- out_txt += thai_number[int(a)]
- print(out_txt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement