Skip to content

Instantly share code, notes, and snippets.

View atul-chaudhary's full-sized avatar
🎯
Focusing

Atul Chaudhary atul-chaudhary

🎯
Focusing
View GitHub Profile
@atul-chaudhary
atul-chaudhary / ImageReducer.py
Created August 28, 2019 06:47
Python Script to compress the size of all image inside a folder without the changing the dimension of the image and save them to other folder.
#PIL (python image library) make sure you have PIL installed, otherwise install it from here my typing commnad ->pip install Pillow
#if you have PIL already you are good to go.
import os
from PIL import Image
def main():
select_folder='C:\\Users\\atulc\\Downloads\\The Best Cars HD Wallpapers' #my first folder or source folder
dest_folder='D:\\my walls\\cars' #my destination folder
for image_path in os.listdir(select_folder):
print(image_path)
@atul-chaudhary
atul-chaudhary / pattern.py
Created September 1, 2019 06:03
Webkul: Campus placement pattern program (round 1 MIET campus 2016-2020 batch)
#webkul pattern program round 1
#pattern runs for odd number like min 3 , 5, 7 etc
#here is ther pattern
#for n==3
* *
** **
***@@@***
@@@
@@@
***
@atul-chaudhary
atul-chaudhary / pattern1.pyt
Created September 1, 2019 12:52
Grapecity: pattern program placement test hiring
#only runs for 1,3 and 5
#pattern is
#n==5
1
232
34543
4567654
567898765
#for n==3
1
@atul-chaudhary
atul-chaudhary / pattern2.py
Created September 3, 2019 11:54
HOTS: pattern program
#for n==9
* * *
* *** *
* ***** *
* ******* *
*---------*********---------*
* ******* *
* ***** *
* *** *
* * *
@atul-chaudhary
atul-chaudhary / pattern3.py
Created September 4, 2019 02:54
HOTS : Pattern program
#pattern run for only off number like ->3,5,7,9,11 etc
#n==3
***********
* | *
* * *
*---***---*
#for n==5
*****************
* | *
@atul-chaudhary
atul-chaudhary / pattern4.py
Created September 4, 2019 03:07
HOTS: pattern program
pattern runs for both odd and even number starting from n==3
n==3
* * * * *
* * *
* * * *
* * * * *
n==4
* * * * * *
* * *
* * * *
@atul-chaudhary
atul-chaudhary / pattern5.py
Created September 4, 2019 04:46
HOTS: pattern programs
enter the height=3
enter the width=3
enter the number of stairs=3
@@@
@@
@
@@@
@@
@
@@@
@atul-chaudhary
atul-chaudhary / pattern6.py
Created September 4, 2019 05:10
HOTS: pattern program
enter the height=3
enter the width=3
enter the number of stairs=3
@@@ @@@
@@ @@
@ @
@@@ @@@
@@ @@
@ @
@@@ @@@
@atul-chaudhary
atul-chaudhary / program.py
Created September 8, 2019 03:07
Print matrix in spiral
a = [[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15, 16, 17, 18]]
int_row = 0
last_row = 3
int_col = 0
last_col = 6
while(int_row<=last_row and int_col<=last_col):
@atul-chaudhary
atul-chaudhary / program.py
Created September 8, 2019 03:07
Print matrix in spiral
a = [[1, 2, 3, 4, 5, 6],
[7, 8, 9, 10, 11, 12],
[13, 14, 15, 16, 17, 18]]
int_row = 0
last_row = 3
int_col = 0
last_col = 6
while(int_row<=last_row and int_col<=last_col):