IF instruction | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

IF instruction

Is a code block the part that comes after the colon (:) character in a "if" statement, or is it the "if" statement together with the code that comes after the colon (:) that's the code block?

28th Feb 2018, 10:01 PM
arbaaz
3 Answers
+ 3
Since you are not specifying the programming language, i'll provide the general concept of code block, which is any group of code inside curly braces"{ }", in the case of an If code block, it would look like this: " if(condition){ conditional code here conditional code here conditional code here conditional code here } That's an if code block, but you can do this as well: if(condition) //First line right after the if condition belongs to the if statement //Second line and beyond does not belong to the if statement Hope this helps Arbaaz.
28th Feb 2018, 10:43 PM
Roberto Guisarre
Roberto Guisarre - avatar
+ 3
if then else elseif - Good question @ACE as this is really vague... The querier is currently doing the html and python tutorials.
28th Feb 2018, 11:53 PM
BroFar
BroFar - avatar
+ 2
My question is regarding the programming language Python. I'm sorry, I forgot to include that in the question.
1st Mar 2018, 12:14 PM
arbaaz