Integers Come In All Sizes

Sort by

recency

|

408 Discussions

|

  • + 0 comments
    a = int (input ())
    b = int (input ())
    c = int (input ())
    d = int (input ())
    
    a_power = (a ** b)
    c_power = (c ** d)
    ac_sum = (a_power + c_power)
    print (ac_sum)
    
  • + 0 comments

    a,b,c,d=map(int, [input() for _ in range(4) ]) print(pow(a,b)+pow(c,d))

  • + 0 comments
    a,b,c,d = [int(input()) for _ in range(4)]
    print(pow(a,b) + pow(c,d))
    
  • + 0 comments

    Trying to do it with the least amount of code…

    a, b, c, d = map(int, [input() for _ in range(4)])
    print(a**b + c**d)
    

    I don't really like using input(), so at first I had the slightly longer…

    import sys
    
    a, b, c, d = map(int, sys.stdin.read().split())
    print(a**b + c**d)
    
  • + 0 comments

    Here is HackerRank Integer Come in all sizes in python solution - https://programmingoneonone.com/hackerrank-integers-come-in-all-sizes-solution-in-python.html