Replace all 0’s with 1 in a given integer

    0

    0

    CrypticSai-08

    n=int(input("Enter any number"))
    s=str(n)
    l=[]
    for i in s:
        if(i=='0'):
            l.append('1')
        else:
            l.append(i)
    ns=""
    for i in l:
        ns+=i
    print(int(ns))
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.