Dear Innovators and Enthusiasts, The FOSSEE team at IIT Bombay warmly invites you to participate in the Scilab Case Study Hackathon, an exciting opportunity to explore innovation and showcase your skills using Scilab. For more details Click here.
I think it is more appropriate to write Solution 2 as:print(n) if n % 10 == 0 else print(10*n)instead of:print(n) if n % 10 == 0 else 10*n
if num%2 == 0: ...: print('even') ...: else: ...: print('odd') File "<ipython-input-2-1f320c4e94c2>", line 3 else: ^SyntaxError: invalid syntax
14587 visits
Outline:if condition statement Demonstration of if statement with example if/else condition statement with example Importance of indentation in a program Usage of colon in program Condition statement using elif Examples using if/elif/else block Ternary conditional statement Difference between if/else and ternary conditional statements How to use pass statement?
if condition statement Demonstration of if statement with example if/else condition statement with example Importance of indentation in a program Usage of colon in program Condition statement using elif Examples using if/elif/else block Ternary conditional statement Difference between if/else and ternary conditional statements How to use pass statement?
Show video info
Pre-requisite