+ 4
Help
Im trying to make a basic calculator i tried this Num1 = input ("Enter A Number") Num2 = input ("Enter Another Number") Result = float(Num1) + float(Num2) Print(Result) but it did not work i went on youtube and tried to get help but no 😢
33 Answers
+ 8
Here you did mistake on the print statement, write In small letters because python is case sensitive
Try this one👍
Num1 = input ("Enter A Number")
Num2 = input ("Enter Another Number")
Result = float(Num1) + float(Num2)
print(Result)
Happy coding :-)
+ 6
Enter the input [numbers] in separate lines otherwise use split() keyword.
For example,
Help
Num1, Num2 = input("Enter 2 numbers with space between them:).split()
#using split() it separates the input and make it as list which you can use it for multiple assignment
Result = float(Num1) + float(Num2)
#now you can use data types for further math operation.
print(Result)
"""
Output:
Enter 2 number with space between them: 5 6
11.0
"""
+ 6
Make the 'P' of 'print fucntion to lowercase
Python is case sensitive bro😊
+ 4
Code Crasher that's why I have explained so that he/she may improve little extra. And also they will be eager to know what it means.
+ 3
Hal0Pr012
Make sure that "P" in the "Print" is lower case i.e., "print(Result)"
+ 3
you can use eval(num1,num2)
+ 3
Lay_in_life It was a well explained response. 👌
While the OP may not fully grasp it until later, others can still benefit from learning an alternative to the separate inputs per line.
+ 3
Write print not Print
+ 3
I'd suggest you to post actual picture of code here. This seems to be right and it should be working.
+ 2
Give the two numbers separated with a line...
+ 2
Hal0Pr012 You can also make the value int/float at the time of input, i.e. float(input())
+ 2
boualleg yasmine, vinita sarda
I would use float instead of integer with the input
Like AKSHAY said
Hal0Pr012 keep trying
+ 1
It says i need input,im a beginner so i dont know what to do.
+ 1
Num1 = input ("Enter A Number")
Num2 = input ("Enter Another Number")
Result = float(Num1) + float(Num2)
Print(Result)
+ 1
It says i need an input and to split lines.idk how to do that
+ 1
Im a beginner i dont know how to do that
+ 1
Hal0Pr012
Just enter first number, press enter, enter another number, again enter to view result
+ 1
input returns a string,you can use eval() to convert a string to a number,then you can add numbers and get what you want.
+ 1
num1= int(input(bla bal bla))
num2=int(input(bla bla bla))
#u gotta put int before input bcz input takes a string and u wanna use integer