cap = cv2.VideoCapture(0) is not opening web camera when executing the command in Google Colab.
Go to Google Colaboratory
Create a new notebook
Click snippet panel
Click Camera Capture. Click insert
Run script: Shift + Enter