2) Write a function that takes a Fahrenheit degree f and returns
its equivalent in Celsius. The formula is:
C = 5 / 9 x (F - 32)
3) A function is implemented with a feature to print a line when
x is found in the array A.
def better_linear_search(A, x):
for i in range(len(A)):
if A == x:
print(x,"found at",i)
return i
return -1
What is the output after running code below?
better_linear_search([17, 2, 10, 3], 10)
better_linear_search([0, 9, 9, 9], 18)
better_linear_search([12, 8, 7, 8], 8)
2) Write a function that takes a Fahrenheit degree f and returns its equivalent in Celsius. The formula is: C = 5 / 9 x
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am