+ 1
Can you help me..pleaseš«š© create this codeš
A bullet is fired vertically into the air at a speed of u m/s (meters/second). After time ts, the distance, s m, traversed by the bullet is given by the formula s = ut-4.91² By building a program code, 1. Calculate the value of s when u = 24 and t = 3 2. Calculate the value of s when u = 100 and t = 5 3. Calculate the value of s when u = 10 and t = 10 This my code ...is this right..šš https://code.sololearn.com/cEtDgAbD0ZY5/?ref=app
3 Answers
+ 2
Ouhh ... thank you for your explanation šš¤š
+ 1
Your Mistakes :
1. 4.91^2
use ** operator to calculate powers
4.91**2
Note Double stars (**) are exponentiation. so it means
4.91 to the power 2
print(4.91**2)
output: 24.1081
print(4.91*4.91)
output: 24.1081
print(4.91^2)
output: unsupported operand type(s) for ^: 'float' and 'int'
+ 1
Hi NURUL!
Your concept and syntax are fine. But the problem is that "^" is known as bitwise xor operator whereas "**" sign is used for exponentiation. ^ can't be applied to floats