"Write a Python program that asks the user to input two numbers and finds the max of those number when they are raised to the power of each other.

Display three numbers in your answer, the first number raised to the power of the second, the second number raised to the power of the first, and then the maximum of these two computed values, each on one line."

The question above is the one im facing now, newer to programming, when i type in the correct, or what i see is correct, it does not work as the correct answer. Obviously im missing something they want here and i dont really understand what it is… Thanks in advance for any help.

My answer -
input(‘Enter an integer >’)
input(‘Enter an integer >’)
first_num = 2
second_num = 3
third_num = 8
print(first_num, ‘to the power of’, second_num, ‘is’, pow(first_num,second_num))
fourth_num = 9
print(second_num, ‘to the power of’, first_num, ‘is’, pow(second_num,first_num))
print(‘the max of’, third_num, ‘and’,fourth_num, ‘is’, max(third_num,fourth_num))

what exactly am i missing here? when the program runs through it gives exactly what the question ask for…

You’re not supposed to hard-code the inputs, nor calculate the powers by hand.

Your solution is not accepted because it does not meet the specifications laid out in the problem description. Your program should work with any numbers input by the user. For example, if the user enters:

2 to the power of 3 is 8
3 to the power of 2 is 9
the max of 8 and 9 is 9

Compare it to what is required:

Display three numbers in your answer, the first number raised to the power of the second, the second number raised to the power of the first, and then the maximum of these two computed values, each on one line.

Three numbers on separate rows is asked and what is provided is not that.

That aside there are problems in the code. Input provided by user is never used, instead hardcoded values are computed. This can be easily remedied

Instead of:

input("Enter an integer >")
input("Enter an integer >")
first_num = 2
second_num = 3

Write:

first_num = input("Enter an integer >")
second_num = input("Enter an integer >")

Now you have stored values entered by user. But there is another catch:

>>> num = input("Enter num: ")
Enter num: 5
>>> num * 5
'55555'

Value returned from input is string. In order to have mathematical calculations it must be converted. Below I convert them to integer (another option is float; you should read carefully the assignment to determine whether use int or float):

first_num = int(input("Enter an integer >"))
second_num = int(input("Enter an integer >"))

Now you have two integers from user you can use them to perform calculations needed.

I am not going to provide a solution. I am going to ask a question.

When the user is asked for an input, where does the answer go?

It clearly does not go into the variable called first_num. Instead, you assign your own number to first_num.

You did the same with your second number.

Until you rewrite it to what was asked, the rest of your program won’t do anything to solve the problem.

Your assignment description is a bit misleading if you only ask the user and ignore what they chose. It says you should use those numbers later.

Consider finding where the manual page defines how to use the input() function. Find the function, which must have been explained in class, that converts a string of characters, assuming they contain numerals, into a number.