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

7th Sep 2020, 6:51 PM
Umang Goswami
Umang Goswami - avatar
6 ответов
+ 7
No. Code blocks are indented following a line that ends with a colon (:).
8th Sep 2020, 1:44 AM
David Ashton
David Ashton - avatar
+ 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
7th Sep 2020, 7:21 PM
Steven M
Steven M - avatar
+ 1
Steven M interesting, python is pretty forgiving neat language, im learning c right now and its like, "YOU MUST KNOW ALL THE DETAILS AMD BE SUPER SPECIFIC AT ALL TIMES FOR I AM C YOUR LORD AND SAVIOR"
8th Sep 2020, 4:03 AM
StealthyTaco
StealthyTaco - avatar
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).
7th Sep 2020, 7:27 PM
gambler
0
Hey gambler , on using semicolon sometimes in terminal and command prompt it shows error
7th Sep 2020, 7:45 PM
Umang Goswami
Umang Goswami - avatar
0
Umang Goswami the semicolon is used to separate lines of code, something like this https://code.sololearn.com/cljy1zAqvkis/?ref=app
7th Sep 2020, 7:55 PM
Steven M
Steven M - avatar