Welcome to Rust vs Python
Table of content
1.
Read line from stdin
2.
Print formatted string
3.
Random number in range
4.
String to int
5.
Exit with code
6.
Read command line arguments
7.
Enumerate string
8.
Enumerate vector
9.
Print line separator
10.
Map vector
11.
Ternary operator
12.
Get min and max of two values
13.
Read/write from/to file
14.
Get current timestamp in seconds
15.
Sleep in async program
16.
Increment dict value
17.
Push value to dict of vectors
18.
Measure execution time
19.
Read environment variable
Light
Rust
Coal
Navy
Ayu
Rust vs Python
Print line separator
Rust
#![allow(unused)]
fn main() {
println!("{}", "-".repeat(80))
}
Python
print("-" * 80)