help me with this program

Report
Question

Please briefly explain why you feel this question should be reported .

Report
Cancel

how i write a python program that the user enter an integer (a) and then calculate the result of a+a*a+a*a*a+a**a

in progress 0
Python 4 months 3 Answer 2382 views 0

About dalia

Answers ( 3 )

  1. Please briefly explain why you feel this answer should be reported .

    Report
    Cancel
    # Python 3.x
    a = int(input("Input a number: "))
    result = a+a*a+a*a*a+a**a
    print(result)
    

    Output:
    Enter a number: 2
    18

  2. Please briefly explain why you feel this answer should be reported .

    Report
    Cancel

    a = int(input (“a=?”))
    print(a+a*a+a*a*a+a**a)

  3. Please briefly explain why you feel this answer should be reported .

    Report
    Cancel

    Also could use:
    Python 3.X
    a = int(input(Enter a number : ))
    print(‘a plus a = ‘,a+a,’\na times a = ‘,a*a,’\na to the power of a = ‘,a**a)
    # I added the \n to print each result on its own line.

Leave an answer

Browse

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>