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

1 2

"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.

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)