Computer Science, asked by pushkar2023, 7 months ago

Given a maximum of four digit integer to the base 17(10->A,11->B,12->C,......,16->G)as input,output its decimal value. Input Format Single line input of base 17

Answers

Answered by hemanthsoma9
1

Answer:

Python : -

       n = str(input())

       t = ''

       for i in n:

             if i in 'ABCDEFGabcdefg':

                  t = int(n,17)

             elif not t:

                  t = 'invalid'

       print(t)      

Explanation:

Similar questions