print()
seems to be showing output just fine.
What specifically are you looking to do? If it is make output, you’ve been successful.
What have you looked into about JupyterLite and the use of input()
? There’s a lot about that here on this forum and on StackOverflow.
Here’s some to get you started:
- Input Function Not Working - #11 by fomightez
- an answer to ‘How to use int(input()) in JupyterLite / Pyodide Kernel’)
- JupiterLab input() function not working - #2 by bollwyvl
Please read Getting good answers to your questions and reply accordingly and draft future posts with that as a guideline.
Variable is Missing…
What is in the screenshot doesn’t include any variable being assigned. Or invoked.
Please read my reply and the linked resources. Especially the one about how to get good answers & the top of my answer to ‘How to use int(input()) in JupyterLite / Pyodide Kernel’. Then try something and provide the code as pasted, formatted text code and not screenshots. Or at least not screenshots alone.
my full code
print(‘Hello’, input(‘What is your name?’))
What is your name? kg
It should show Hello kg as an output. it works fine in google colab, why not in jupyter
You sort of answered yourself by finding where to post this. You have posted this under the title of ‘Unable to see output in jupyter lite’ because you are using JupyterLite that has a special kernel that doesn’t yet have all the abilities of a typical, fully-capable Python kernel (ipykernel). Note in the screenshot in the upper right corner of the kernel indicator where it says “(Pyodide)”.
See here and above there for how you have to change the code to work in JupyterLite using the special Pyodide kernel. Or keep that code & switch to using JupyterLab with a typical Python kernel (ipykernel) using MyBinder to serve you a temporary Jupyter session running on a remote machine. Google Colab also runs on a remote machine with a true Python kernel backing it. So to directly answer the last part of your post where you ponder “why not in jupyter”, that code does work in Jupyter if you use the corresponding tech.