+ 2
What's wrong with my code pls help me
I has written a code this https://code.sololearn.com/c9QUqkkT8GJU/?ref=app This is not working properly pls anyone help me
37 Respostas
+ 5
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())
+ 3
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"))
+ 2
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)
+ 1
What are you trying with this code? Add details..
+ 1
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.
+ 1
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
+ 1
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...
0
I am doing test in learn section
0
Ohh thx
0
Output = $0.01 powered by 30
0
Then also it is saying no input
0
Help me
0
Thx
0
You are so genius
0
Can you pls make a code and send me
0
Pls
0
I will perfectly understand
0
Ok. But why don't you try... I already explained in details what changes you need. Try and post.