"Forget" about indentaition. You should still write beautiful code, but if you mess up with tabs/spaces, or copy one piece of code to another that uses a different indentation style, it won't break.
This is the recommended way. Type instance will raise an exception if you set an invalid (or non-existent) parameter. params = mycam.devicemgmt.create_type('SetHostname') params.Hostname = ...