Your code never reaches to the if condition, because after return statement, It will exit from the get_bitcoin_price function and will never reaches to the conditional part.
Remove the return current_price line from your code.
You have only declared the get_bitcoin_price function but you have not called it any where.
Only write the controlling part in the while loop.
brother your function is never called so the you will never retireve the bitcoin status so just assign the function to a value and compare them to activate the buzzer and set your selling price according to the values you see in the documentation provided in the task1.
Hi h4heet,
just call the function get_bitcoin_price() in the if loop and the time.time() in the second if loop does not increment the timer, so add the time.sleep(5), it will stop the response after 5 seconds., and since your dealing with while loop, be careful as it might, cross the message rate…
Hey @h4heet,
As you have written the conditions for checking the price under a user defined function, you need to call the function with appropriate parameters.In this case you need to call the get_bitcoin_price. Just call the function like get_bitcoin_price(selling_price). It should work now.
Cheers!