Amongst which of the following if syntax is true?

23. Amongst which of the following if syntax is true?

  1. if condition:
        #Will executes this block if the condition is true
    
  2. if condition
    {
        #Will executes this block if the condition is true
    }
    
  3. if(condition)
        #Will executes this block if the condition is true
    
  4. None of the mentioned above

Answer: A)

if condition:
    #Will executes this block if the condition is true

Explanation:

If is a keyword which works with specified condition. If statement in Python has the subsequent syntax:

if condition:
    #Will executes this block if the condition is true 

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.