change input to integer

    0

    0

    This code takes an inout by user and converts to integers, and then adds them together.

    # This takes an inout by user and converts to integers and adds them together.
    two_digit_number = input("Type a two digit number: ")
    print(type(two_digit_number))
    first_digit = int(two_digit_number[0])
    second_digit = int(two_digit_number[1])
    two_digit_number = first_digit + second_digit
    print(two_digit_number)
    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.