+ 1

Identify a difference between C# and Python

in c# we identify the code of the function by putting it between { } but in python we start with : it's easy but how can I know the end of the function code and what will happen if I nested more than if together is the spaces i left in the beginning of each line will be the only difference as a beginner with Python it could be a problem for me and thanks in advance ☺☺

21st Jan 2018, 10:11 PM
Mohammed
Mohammed - avatar
5 odpowiedzi
+ 12
You accidentally made a duplicate, please remove one
21st Jan 2018, 10:16 PM
Dapper Mink
Dapper Mink - avatar
+ 10
You're welcome :)
21st Jan 2018, 10:18 PM
Dapper Mink
Dapper Mink - avatar
+ 9
Use tabulations (spaces at the beginning of each lines) so that Python knows what is considered as inside of a block and what isn't ;)
21st Jan 2018, 10:16 PM
Dapper Mink
Dapper Mink - avatar
+ 2
okay thanks
21st Jan 2018, 10:18 PM
Mohammed
Mohammed - avatar
+ 2
pythons function body is 4 space indent if it has a nested statement its another 4 and so on. So if a new line is not indented its not part of the function.
21st Jan 2018, 10:31 PM
emmey
emmey - avatar