#range #python #py

yugen

Writing rust like python

10 releases

0.1.9 Mar 17, 2024
0.1.8 Mar 17, 2024

#3 in #py

23 downloads per month

Apache-2.0

4KB
73 lines

#yugen

Writng rust like python

##examples_code:

use yugen::py_range;

fn main() {
    // Example 1: Iterate from 0 to 5 
    println!("Example 1:");
    for a in py_range!(5) {
        println!("{}", a);
    }

    // Example 2: Iterate from 0 to 5 
    println!("Example 2:");
    for b in py_range!(0, 5) {
        println!("{}", b);
    }

    // Example 3: Iterate from 0 to 5
    println!("Example 3:");
    for c in py_range!(0, 5, 1) {
        println!("{}", c);
    }
}

No runtime deps