printing numbers

    0

    0

    Mahendra Kumar

    designbeginnerlogic

    Print numbers in a given range in Python using While Loop

    def print_num(n):
       if n > 0:
          print_num(n - 1)
          print(n, end = ' ')
    n = int(input())
    print('printed numbers are:')
    print_num(n)
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.