Project 12 Bitcoin

I am getting any abnormal error stating–> invalid character in identifier

I have attached the image please help!

Know more about python identifiers here.

https://www.tutorialspoint.com/python/python_basic_syntax.htm#:~:text=A%20Python%20identifier%20is%20a,digits%20(0%20to%209).&text=All%20other%20identifiers%20start%20with%20a%20lowercase%20letter.

Still getting problem? then show your code.

hi @vvksinghai17
By looking in this attached image, I think you haven’t given space b/w print and the brackets. It should be like this:
print (“The current price is”, price_fetched)
:point_up: one space here
If this is not the issue then please send the code you have written.

Hi @vvksinghai17

Please check the spelling & letter case. As python is a case sensitive language, check it once more whether the identifier called in print function is the same as of the variable defined before.

Hope this helps…

Here is my code, I have tried giving space b/w brackets & print still same error I was getting.

My code is in below reply . please check and suggest correction.

Hi @vvksinghai17
The problem is in your while loop. It should be like this:

while True:

price_fetched = get_bitcoin_price()
print (“The current price is”, price_fetched) # The content in double quotes should be green in color.
print (“Your selling price is”, selling price)# The content in double quotes should be green in color.
if price_fetched > selling_price:

print (“The current price is greater than the selling price”)# The content in double quotes should be green in color.
buzzer = mybolt.digitalWrite (‘0’, HIGH)
print (buzzer)

time.sleep(30)

*the double quotes you entered in print should be same as the ones you used in URL ="…"

*the if condition in the while loop should have correct spaces as i have shown above and the last line time.sleep(30) should be inside the while loop.

Hope this works for you…:+1::+1::+1:

2 Likes

Thanks @joemonjohnson17 it worked !!