Code block - Python - Mimo

文章推薦指數: 80 %
投票人數:10人

If statements don't decide on skipping or running the entire code. They only make decisions about a code block. · We use an indentation of two spaces to ... getitongoogleplayCreatedwithSketch.Ukraine,westandwithyou!-WaystohelpAboutusBlogGlossaryLOGINSIGNUPSIGNUPAboutusBlogGlossaryLOGINHTMLCSSJavaScriptPythonAliasBooleansClassesCodeblockConditionsConsoleConstructorEqualityoperatorFalseFloatForloopFormattedstringsFunctionsGreaterthanoperatorGreaterthanorequaltooperatorIfstatementIndexInequalityoperatorIntegerLessthanoperatorLessthanorequaltooperatorListsMethodsParamaterParameterReturnSnakecaseStringThenotoperatorTrueVariablesWhileloopappend()insert()pop()Python> CodeblockCodeblockIfstatementsdon'tdecideonskippingorrunningtheentirecode.Theyonlymakedecisionsaboutacodeblock. ifTrue: print("I'macodeblock!") Weuseanindentationoftwospacestohighlightcodeblocks,likehowweindentedthedisplaystatementtwospacestotheright. ifTrue: print("I'mtwospacesaway!") Acodeblockcanbemorethanaone-liner.Alllineswiththesameindentationbelongtothesamecodeblock. Wecanseeitherewhenweuseprint()toaddonemorelineatthebeginning. ifTrue: print("Lookatme!") print("I'macodeblock") TRYITONTHEAPP



請為這篇文章評分?