We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e900edb commit 88c9cc0Copy full SHA for 88c9cc0
1 file changed
practice/sort_max_number.py
@@ -0,0 +1,9 @@
1
+a = [54, 546, 548, 60]
2
+
3
+for j in range(len(a)):
4
+ for i in range(len(a)-1):
5
+ if str(a[i])+str(a[i+1]) < str(a[i+1]) + str(a[i]):
6
+ temp = a[i]
7
+ a[i] = a[i+1]
8
+ a[i+1] = temp
9
+print ''.join(map(lambda x : str(x),a))
0 commit comments