Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

itertools

from itertools import combinations
from itertools import permutations
Comment

itertools

colors = ["red", "green", "blue", "purple"]
ratios = [0.2, 0.3, 0.1, 0.4]
for i, color in enumerate(colors):
    ratio = ratios[i]
    print("{}% {}".format(ratio * 100, color))
Comment

itertools

for start, end in zip(start_points, end_points):
    if start[0] == -end[0] and start[1] == -end[1]:
        print(f"Point {start[0]},{start[1]} was negated.")
Comment

itertools

>>> head, middle, tail = numbers[0], numbers[1:-1], numbers[-1]
>>> head, *middle, tail = numbers
Comment

PREVIOUS NEXT
Code Example
Shell :: add current directory to path 
Shell :: Kali free ports 
Shell :: docker-compose update code without using build again 
Shell :: configuration file is group-readable. This is insecure linux 
Shell :: git revert merge 
Shell :: zsh: no matches found: with * 
Shell :: ubuntu install tar.xz 
Shell :: epub linux reader 
Shell :: install python 2.7 kali linux 
Shell :: git log show diff 
Shell :: linux bash how to clear log files debian ubuntu centos 
Shell :: install psql 
Shell :: git remote origin 
Shell :: git merge force 
Shell :: bash check for substring in string 
Shell :: composer xampp windows 
Shell :: set zsh as default linux 
Shell :: change language to english in centos 
Shell :: install zip raspberry pi 
Shell :: whoami 
Shell :: ubuntu output to file and terminal 
Shell :: enable rdp windows 10 powershell 
Shell :: shell function example 
Shell :: ubuntu reset path 
Shell :: Failed to install the following Android SDK packages as some licences have not been accepted. build-tools;28.0.3 Android SDK Build-Tools 28.0.3 platforms;android-29 Android SDK Platform 29 
Shell :: linux subsystem for windows file location 
Shell :: linux scroll in flutter 
Shell :: how to open text editor in git bash 
Shell :: download aws cli linux 
Shell :: create chrome and firefox extension in react 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =