+ 2
In this python code I only want one input not two
pi=3.14 radius,side=input().split() radius=float(radius ) side =float(side) area_c=pi*radius*radius area_s=side*side print ("\n Area of circle: %2f"%area_c) print("Area of square: %2f"%area_s)
6 Respostas
+ 4
Input: 2.5 10.25
radius,side = *list(map(lambda x: float(x), input().split()))
print(radius, side)
print(3.14*radius*radius)
print(side**2)
Output:
2.5 10.25
19.625
105.0625
+ 3
If I am understanding you correctly, you do not want:
radius,side=input().split()
If this is the case you will need to hard code one of those values:
radius=2
side=input()
OR
radius=input()
side=2
+ 2
Change your code like thisâ
pi=3.14
radius=side=input().split()
radius=float(radius[0])
side =float(side[0])
area_c=pi*radius*radius
area_s=side*side
print ("\n Area of circle: %2f"%area_c)
print("Area of square: %2f"%area_s)
in your code you must give two inputs. because
radius,side=input().split()
means,
radius=input().split()
and side is not get any value.So this code shows value error.
+ 2
Bro now also didn't getting answer
+ 2
Mohan 333 thats not true, his code is taking 2 inputs separated by a white space. So an input of:
2 4
Would set
radius=2
side=4
+ 1
Now is it right?
Steven M Namit Jain Sourabh Tewatia
Input:2 4
Output: 12.560
16.000
https://code.sololearn.com/cD9UnqUtxKyv/?ref=app