5 Respostas
+ 1
Ah okay. Yeah, anonymous scopes can't be made, it has to be a function, class, container or whatever.
+ 3
Python is based on indentation
That's mean tabs for example
This is in C++:
int add(int a, int b) {
return a+b;
}
In C++ spaces(tabs) is optional
This is in python:
def add(a,b) :
return a+b
The tab in the second line after colon is compulsory
+ 2
If you want a comprehensive description of blocking in Python:
https://code.sololearn.com/cT5BRIbkia21/?ref=app
+ 1
I just want to create nested block like below.
int func()
{ //1 st block
//created block inside function
{ // block
Int I;
}
return 0;
}
Please don't suggest nested function.