- 3
In Python Language "input Function" isn't work Please tell me How to write input Function in Python in SoLo Larn App
30 Answers
+ 2
Hey Taking Input And Presenting Your Output After Performing Operations On Your Input Is The Major Task.
You Can Take Input-
x=input()
In Above Statement Input is a predefined FunctionWhich Will Take Input From You And Store It In The Variable Called x.
Now If You Want To Perform Formatting Or By Default Your Input Is In String Format So If You Want Your Input in integer or floating point format then you have to perform formatting.
x=int(input()) - This Statement First Ask For Input As String Then Change It’s formatting from str to int and then assign it to variable called x.
Same You Can Perform For Floating Point Numbers.
x=float(input()) - This Statement First Take Input As String Then Typecast It To float and then Assign It To x.
May Be This Explanation Helps You 😊
+ 8
DEVARSH PANCHAL, this is not the way sololearn is working. It is a "self-learning" platform, that means that the user has to take stuff like tutorials, code challenges and so on, and work through them. And he is responsible for his own growing progress in learning. If the user stuck somewhere in this process, he is free to ask the great sololearn community. So in your case : Go through the necessary tutorials and do exercices to get familiar with all these things. Then you don't need to ask how to add two numbers or other very basic staff. Thanks!
+ 3
U only enter the number if u want to print it u should do this
print(n1)
Beacause input function take a value form the user only not print it on screen
DEVARSH PANCHAL
+ 3
num1=int(input("pls enter first
number "))
num2=int(input("pls enter second number "))
print(" the first number is "+num1)
print("\n")
print("the second number is "+ num2)
DEVARSH PANCHAL
+ 3
He is a begainner person will not know the format function
Granger
thats for u
num1=int(input("pls enter first
number "))
num2=int(input("pls enter second number "))
print(" the first number is {} ".format(num1))
print("\n")
print("the second number is {}"
.format(num2))
+ 3
#I think u want to write this
For nums
X = int(input( ))
For str
X =str(input( )) or X= input(" ")
+ 2
You're welcome ☺️☺️
DEVARSH PANCHAL
+ 1
Please show your code ☺
+ 1
when it comes to numbers you should use infront of input and try it again
0
print ("Enter your number")
n1= input()
0
And When i enter the number
Only print Function work
0
Thanks
0
i can't understand properly please write a code
0
thanks
0
And Please Tell me How to add tow number in Python
Please write code
0
A = input ("what is your name?: ")
print (f"hello {A}")
Try something like this
0
Ich habe ein code
0
No, unfortunately not. In sololearn playground you have to enter all needed inputs before any action is possible.
0
Can someone tell me a few of there programing proyects with our love Python?
0
Use
num=int(input("enter the number"))
print(num)