Skip to content

Instantly share code, notes, and snippets.

View sid86-dev's full-sized avatar
🤠

Siddhartha Roy sid86-dev

🤠
View GitHub Profile
@sid86-dev
sid86-dev / filenames.py
Created October 13, 2021 19:23
Extract names of files which are in a folder to a csv file
import os
import csv
class Readname():
def __init__(self, loc):
self.loc = loc
# get list of filenames in the folder
def listNames(self):
'''1.
If you are a list of integers (that are non negative) write a program to return an integer list of the
rightmost digits.
right([1,22,94]) ->[1,2,4]
right([10,0]) ->[0,0]
'''
def right(lst):
new_lst = []
@sid86-dev
sid86-dev / concept.py
Created September 5, 2021 16:46
Concept Calculator Flask
if request.method == "POST":
option = request.form.get('option')
num1 = request.form.get('num1')
num2 = request.form.get('num2')
if option == "Addition":
data = num1 + num2
elif option == "subtraction":
datd = num1 - num2
elif option == "subtraction":
def hello(x):
return f"Hi, {x}"
h = hello("Sid")
print(h)
def hello(x):
return "hello", x
print(Sid)