diff --git a/comm_code.py b/comm_code.py index 687f63c..6fb97d6 100644 --- a/comm_code.py +++ b/comm_code.py @@ -1,7 +1,7 @@ # purpose : write a program to read a list and convert that list into comma seperated string # author : rakesh kumar # licence : MIT -spam =['apples','banana','oranges','mango'] +spam =['apples','banana','oranges','mango','kivi','cheeku','pine apple','strawberries'] string ='' n = len(spam) for i in range(1,n): diff --git a/fileHandling/folderManager.py b/fileHandling/folderManager.py index 9eb19f4..5444c7d 100644 --- a/fileHandling/folderManager.py +++ b/fileHandling/folderManager.py @@ -11,8 +11,6 @@ import tkinter.messagebox -source = r'C:\Users\rakesh\Documents' - filetype = {'docs': ['doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt', 'rtf', 'odf', 'odt'], 'pdf': ['pdf'], 'img': ['jpg', 'jpeg', 'png', 'gif', 'bmp'], @@ -24,12 +22,12 @@ def filemove(file, filetype, key): if(file.split('.')[1]) in filetype[key]: - if (os.path.exists(source+'/'+key) == False): - os.mkdir(source+'/'+key) - elif(path.isfile(source+'/'+key)): - os.mkdir(source+'/'+key) + if (os.path.exists(sourcedir+'/'+key) == False): + os.mkdir(sourcedir+'/'+key) + elif(path.isfile(sourcedir+'/'+key)): + os.mkdir(sourcedir+'/'+key) try: - shutil.move(root + "/"+file, source+'/'+key) + shutil.move(sourcedir + "/"+file, sourcedir+'/'+key) except: pass @@ -48,4 +46,4 @@ def filemove(file, filetype, key): if(file.split('.')[1]) in filetype[key]: filemove(file, filetype, key) -tkinter.messagebox.showinfo('Window Title', 'Please check your Folde now') +tkinter.messagebox.showinfo('Folder Manager', 'Please check your Folde now') diff --git a/functions/recursion/natutal_no.py b/functions/recursion/natutal_no.py index 44004b2..ceddebe 100644 --- a/functions/recursion/natutal_no.py +++ b/functions/recursion/natutal_no.py @@ -4,5 +4,20 @@ def natural(n): else: print(n) return natural(n-1) + + +def natural1(n): + if n == 100: + print(100) + return + else: + print(n) + return natural(n+1) +# function call to print 100 natural no + + # function call to print 100 natural no -natural(100) \ No newline at end of file + +natural(1) +#natural(100) + diff --git a/turtle.py b/turtle.py index 093b452..069c1a3 100644 --- a/turtle.py +++ b/turtle.py @@ -1,12 +1,10 @@ import tkinter from turtle import * -begin_fill() while True: forward(200) left(170) if abs(pos()) < 1: break -end_fill() done()