38 AnswersNew Answer
a = input("enter the amount: ") b = input ("enter no. of days: ") The above 2 lines accept 2 inputs of string type. And displays string given in input("sting argment") argument. And next print (" a * * b ") just print string 'a * * b' because you added it in Quotes so it becomes a normal string... Remove quotes and space between as print(a**b) this does expression of a power of b. Before this you need convert input into integer type from string type as a = int( input( "a value \n") here \n adds new line in output.. make these changes and try... to convert float use a=float(input())
Tirthor's Gaming print(a**b) You used expression inside a string. And , make your inputs as float. a=float(input("enter the amount: ")) b=float(input("enter no. of days: ")) And if you want to print input prompt strings in line by line, you can use \n to do this. a=float(input("enter the amount: \n")) If you want to input a integer, you can use int() function . a=int(input("enter the amount: \n"))
You have printed a string a**b but not it's result. To print the result of a**b remove double quotes in the print statement. If you use double or single quotes in a print statement, you are telling the compiler to print a string. Avoid unnecessary spaces tooo. (in between operators) You should also specify the type of the input to be taken... Use this code for your required output - a = int(input("enter the amount: ")) b = int(input("enter no. of days: ")) print (a**b)
What are you trying with this code? Add details..
What output do you expect from the program? Please give example. Remember: input returns a string. You need convert in case you require a numeric type.
a = float(input("enter the amount:\n")) b = float(input("enter no. of days:\n")) print (a**b) #this is corrected code .. see changes and understand..Tirthor's Gaming
https://code.sololearn.com/c9jaOAnNMwqQ/?ref=app U have forget to use bracket so , here is the code #this is corrected code .. see changes and understand..Tirthor's Gaming u can also give data type like int float etc.. if u want to use datatypes use int(input()) to do so #int type
Tirthor's Gaming in that problem,you don't need any input. "The problem is -ones salary is 0.01$ doubled every day for 30 days and other ones is 1.000.000$ . so find which one salary is high and print high salary". There are details given how to do with an example. Understand and apply to problem...
I am doing test in learn section
Output = $0.01 powered by 30
Then also it is saying no input
You are so genius
Can you pls make a code and send me
I will perfectly understand