22nd Sep 2024, 2:43 PM
Muna Orah
Muna Orah - avatar
8 RĂ©ponses
+ 1
Because you aren't calling the defined function volume
22nd Sep 2024, 3:02 PM
Luo Shenshi
Luo Shenshi - avatar
+ 3
Muna Orah 1. you don't need arguments, since the inputs are inside the function already. 2. you are multiplying strings. convert to int. 3. as Luo Shenshi said, you did not call the function. you only defined it. 4. you need to print the result in order to actually see it. def volume(): # no need for arguments # convert inputs to int a = int(input("enter the length of the fish tank: ")) print(a) b = int(input("enter the depth of the fish tank: ")) print(b) c = int(input("enter the height of the fish tank: ")) print(c) return (a * b * c) / 1000 v = volume() # call the function, assign to variable print(v) # print to see the result ''' sample Sololearn input: 2 4 6 submit '''
22nd Sep 2024, 4:26 PM
Bob_Li
Bob_Li - avatar
+ 2
Correct code: #fish tank volume problem. # main program def volume(a,b,c): return (a * b * c) / 1000 print(volume(10, 20, 30))
22nd Sep 2024, 3:06 PM
Luo Shenshi
Luo Shenshi - avatar
+ 2
Luo Shenshi right...😁 I edited my reply because I was worried the function call part would be mixed up with the print result step. I did not remember to change the original print(volume()) part. Thanks for the reminder. 👍 I corrected my post above.
22nd Sep 2024, 4:56 PM
Bob_Li
Bob_Li - avatar
+ 1
Bob_Li no need to print volume if you can print v
22nd Sep 2024, 4:49 PM
Luo Shenshi
Luo Shenshi - avatar
+ 1
No invocation to the function defined.
23rd Sep 2024, 9:23 AM
Oliver Pasaribu
0
n
23rd Sep 2024, 10:32 PM
ahmed Husen
ahmed Husen - avatar
0
a,b,c
24th Sep 2024, 12:00 PM
Kale singh Warkade
Kale singh Warkade - avatar