Skip to content

Instantly share code, notes, and snippets.

@towkir
towkir / nested_to_flat_array.html
Last active September 8, 2016 01:00
This script takes a nested array of integer numbers and returns a flat array
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Arrays</title>
<style>
body {
font-family: monospace;
margin: 50px;
}
@towkir
towkir / nested_to_flat_array.py
Last active October 28, 2016 07:52
This script takes a nested array of integer numbers and returns a flat array
print("This program takes a nested array of integer numbers and returns a flat array")
print("Press Ctrl+C to exit")
try:
while True:
flat_array = []
nested_array = input("Pleas input your arbitrary array:\n")
def loop_through_list(given_list): # this function checks if list items are a list themselves
for a in given_list: # and if so, it calls itself within that list item.
if type(a) == list:
@towkir
towkir / cellular-tax-calc.py
Last active August 30, 2016 14:37 — forked from maateen/cellular-tax-calc.py
This will take a float number as input and show the total number with tax. (Bangladesh)
#/usr/bin/python3
print("Press 'Ctrl+C' to exit this tool.")
try:
while True:
print("\nPlease input price in BDT: ")
a = raw_input()
try:
float(a)
except ValueError: