DEV Community

Nikhil Chandra Roy
Nikhil Chandra Roy

Posted on

1 2

"while loop developer" how to use pug/jade, scss, javascript, python(backend) - (Stack Tutorial 2)

Hi guyes,
This is tutorial 2,
The previous tutorial we have learnt how to use for loop pug/jade, scss, javascript, python(backend) Here you can see
This tutorial we will use basic while loop in our stack web development.

1. PUG/JADE
In this pug/jade tutorial we can use this pug to html converter for practice purpose PUG TO HTML

Example 1

- var i=0
ul
 while i < 10
  li= i++


Enter fullscreen mode Exit fullscreen mode

2. SCSS

Example 1

$border: 1;
@while $border < 10+1{
    li:nth-child(#{$border}){
        border: #{$border}px solid red;

    }
    $border: $border+1
}

Enter fullscreen mode Exit fullscreen mode

3. Javascript
while loop
Example 1

let li = document.querySelectorAll('li');
let i = 0;
while(i < li.length){
    li[i].style.color = 'yellow';
    console.log(i)
    i++;
}
Enter fullscreen mode Exit fullscreen mode

while loop with do (js)
Example 2

do{
    li[i].style.color = 'yellow';
    console.log(i)
    i++;
}
while(i < li.length)

Enter fullscreen mode Exit fullscreen mode

"do" and while is very simple to use and the "while" making the condition and the "do" execute the callback.

Finally, Python
4. Python

Example 1

count = 0
while count < 10:
    print(count)
    count+=1

Enter fullscreen mode Exit fullscreen mode

It almost looks little same as javascript but python has only 2 primitive loop

  • For
  • while

This is my sort tutorial hope you like it.
if you like this sort tutorial please like, comments.
Thanks.

SurveyJS custom survey software

Build Your Own Forms without Manual Coding

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

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more