0
So confused
Ok so I am new to programming/coding if I’m writing a program how do I know where I need to put the symbols for example if I need to put a bracket somewhere I don’t know where to put it if this makes any sense
6 odpowiedzi
+ 2
I think you need to go through some basic syntax. From my perspective, programming is just like learning a new language that computer can understand. So what should you do if you want to learn a new language? you should study grammar syntax vocabs and so on. Everyone starts from scratch, so don't worry, i struggled a lot when I started programming. just keep working on it like taking some tutorials on YouTube or taking a course on sololearn.
+ 2
Well mate, of all three you mentioned, AFAIK only CSS uses brackets and semicolon in codes.
Python and HTML uses line indentation (alignment depth) to style the code (no brackets used or needed).
In HTML it's not even required, more about code readability (Bad indentation is tolerable). In Python however, indentation plays a big role, being badly indented, a Python code would refuse to run.
Curly brackets and semicolons are used in C language, C++, C#, Java and JavaScript (AFAIK), brackets, in these languages indicates the beginning & end of a code block (block that consists of multiple instructions). A code block may represent a function, a loop body, a lambda function and many more (I begin to lose grip here).
Square brackets also are used (for different purposes), usually square brackets are used for array indexing (In JS they also construct arrays IIRC).
These are my limited understanding of what I learned so far, hope that helps a bit : )
+ 1
Sorry, I forgot! square brackets are indeed used in Python, to build a list, or to do something with a particular item in a list (not much to tell, I know just very little of it).
+ 1
thanks bro i really appreciate it you ( and everyone else ) has helped out quite a bit actually !! thanks so much
0
Specify the language in your Relevant Tags please, code styles differs between languages, it is unclear which language was referred to by the question.
https://www.sololearn.com/Discuss/333866/?ref=app
0
mainly python ,html, and CSS