DEV Community

Cover image for "if else condition" how to use pug/jade, scss, javascript, python(backend) - (Stack Tutorial 3)
Nikhil Chandra Roy
Nikhil Chandra Roy

Posted on

"if else condition" how to use pug/jade, scss, javascript, python(backend) - (Stack Tutorial 3)

Hi Friends,
We are going to use the condition of our stack learning.
Previous Post

Open up git bash in the current folder
and type

code . index.pug style.scss script.js hello.py

It will create file and open the Visual Studio code editor.

  • index.pug
  • style.scss
  • script.js
  • hello.py

Pug/Jade
for pug/jade compiler now we are going to use visual studio code to compile the pug to html code directly.
Live pug to html compiler
Example 1

- var time= true
if time == true
 h1 I am true
else
 h1 I am false
Enter fullscreen mode Exit fullscreen mode

Scss
Example 1

@mixin bdr($px,$type,$color,$boll: true){
  @if $boll{
    border: $px $type $color;
    border-radius: $px;
  }
  @else{
    border: $px $type $color
  }
}


.demo{
  width: 200px;
  height: 200px;
  background: red;
  @include bdr(20px,solid,black);

}
Enter fullscreen mode Exit fullscreen mode

Javascript
Example 1

let time = true;
if(time==true){
  console.log(" I am true")
}else{
  console.log(" I am false")
}

Enter fullscreen mode Exit fullscreen mode

Python
Example 1

name = ["nikhil","sonchoy","shanto"]
if "nikhil" in name:
    print("Name has nikhil name")
elif:
    print("Name has no nikhil name")

Enter fullscreen mode Exit fullscreen mode

Example 2

country = True
if country == True or country != False:
    print("Country is true")
elif:
    print("Country is false")
Enter fullscreen mode Exit fullscreen mode

There are a lot of examples but we just use very basic concepts to go farther.
If you interested in this post like, comment, and follow me.
Thanks.

Discussion (0)