What's wrong with my code pls help me | Sololearn: Learn to code for FREE!

+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

6/15/2021 12:07:34 PM

Tirthor's Gaming

38 Answers

New Answer

+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

https://code.sololearn.com/ci9MHG62s6vi/?ref=app

+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

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

+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

0

Output = $0.01 powered by 30

0

Then also it is saying no input

0

https://code.sololearn.com/cXO43iUcYwNJ/?ref=app

0

0

0

You are so genius

0

Can you pls make a code and send me

0

0

I will perfectly understand