0
How is if-else from c is different from if-else in python?
2 Answers
+ 5
Just keep syntaxes clear in your mind.
Logic is same in both langs.
Only a thing you have to keep in mind of using proper indentation in python while in c , it's {} braces.
Demo....
C
if( age > 18 ) {
printf("Adult");
}else if(.......){
//code here
}else {
//code here
}
Python
if (age > 18): # para not compulsory
print("Adult")
elif (........ ):
#code here
else:
#code here
+ 4
Syntax only different.