0
Can we use parantheses {} (pardon if i say it wrog) to define block of code in python as done in JAVA,C and also use ; in python
Can we use parantheses {} (pardon if i say it wrog) to define block of code in python as done in JAVA,C and also use ; in python. I am having this doubt because I am absolutely newcomer beginner in Python but has basic knowledge of JAVA. So I tend to use some part of java also. Plz tell
6 ответов
+ 7
No. Code blocks are indented following a line that ends with a colon (:).
+ 2
In Python the "curly brackets" {} are used to create a dictionary. However in that dictionary you can store just about anything, functions included.
https://code.sololearn.com/cs9HQL5QIwGW/?ref=app
https://code.sololearn.com/cq12Bd2tgatz/?ref=app
0
You can't use parenthesis to define block of code.
Semicolons are allowed at the end of the statements but not required (unless you want to put many statements in one line).
0
Hey gambler , on using semicolon sometimes in terminal and command prompt it shows error
0
Umang Goswami the semicolon is used to separate lines of code, something like this
https://code.sololearn.com/cljy1zAqvkis/?ref=app