Computer Science, asked by vanshsharma3677, 3 months ago


In Python, Which of the following will
create a block in a compound
statement.
a)colon
b)Statements indented at a lower
c)()
d){}

{​

Answers

Answered by Anonymous
6

Answer:

Hey buddy the correct answer is ( b ) indented statements .

Answered by guruu99
0

Answer:

The correct answer is d). A block in a compound statement is created with a set of curly braces, {}. A colon, (), or statements indented at a lower level will not create a block in a compound statement.

Explanation:

A block in a compound statement is a group of related statements that performs a specific task. When a block is created with curly braces, the statements within the block will be executed together as one. This gives the programmer more control over their code and allows them to create more complex programs.

For example, a while loop is a type of compound statement that contains a block of code. The while loop is used to execute code repeatedly until a specific condition is met. This while loop can be used to loop through an array of numbers and print out the numbers that meet a certain criteria. Without the ability to create a block in a compound statement, this type of looping would be much more difficult to write.

In Python, creating a block in a compound statement is done by using curly braces. This is because Python uses indentation to define scope and hierarchy. Curly braces allow the programmer user to use group related statements together and ensure that those statements are executed as one single unit.

To know more about python

https://brainly.in/question/49222417

https://brainly.in/question/55810297

#SPJ3

Similar questions