Title says it all, how can be created with code a Scene (web) Layer from associated feature (web) layer in AGOL.
It can be done manually in AGOL with the GUI.
So the best bet would be arcgis.gis module — arcgis 1.8.1 documentation although there is nowhere in documentation explaining how this can be accomplished, and why is that important to have a scene layer with associated feature layer check here: http://140.207.158.228/latest/guide/working-with-scene-layers/