Jupyter not showing output
I replicated the linear search and the binary search functions. They run without error, but the True and False after the tests do not show up. Yes, I told the function to return found. In fact, I eventually copied and pasted the entire 365 Data Science code into my notebook, and I still have problems. The provided class code works, but my copied and pasted version of it does not show the True and Falses after the tests. Please help!
NOTE: the code I wrote works in Spyder. Just not in Jupyter.
def linear_search(item, my_list):
i = 0
found = False
while i < len(my_list) and found == False:
if my_list[i] == item:
found = True
else:
i = i + 1
return found
test = [6,5,8,2,3,45,87,24,70]
print(linear_search(4,test))
print(linear_search(88,test))
No true or falses show up.
Hey Matt,
Thank you for your question!
Could you please do the following:
1. Share a screenshot of these two cells in the Jupyter notebook.
2. Let me know what key combination you are using to execute the cells.
3. Let me know which browser you are opening your Jupyter notebook with.
4. Restart the kernel, run the cells again and let me know if the output shows up.
Thank you!
Kind regards,
365 Hristina
Hey there,
I am sorry to waste your time. It is working fine today. I am not sure what was up, but whatever. I am in Chrome. Here is the picture, not that you need it anymore. Thanks anyway!
Hey again Matt,
No worries, let us know if it happens again.
Kind regards,
365 Hristina
I am not getting any output in Jupyter