Question #242463

Give a string, write a program to move all the numbers in it to its end

Expert's answer

import sys


str1 = ""
str2 = ""
for c in input("Enter the strings: "):
    if c>='0' and c<='9':
        str2 += c
    else:
        str1 += c
rawstr = str1 + str2
print(rawstr)
 

LATEST TUTORIALS
APPROVED BY CLIENTS