Posts

Showing posts from September, 2020

Practice of all

import os,shutil audio_extensions =('.mp3','.m4a','.wav','.flac') video_extensions =('.mp4','mkv','.flv','.mpeg','.csv') documents_extensions =('.doc','.pdf','.txt') folder_path = input('enter folder path :') def file_finder(folder_path,file_extensions):     files = []     for file in os.listdir(folder_path):         for extension in file_extensions:             if file.endswith(extension):                 files.append(files)     return files print(file_finder(folder_path,documents_extensions))

Ch 45 default parameters

 def user_info(first_name=None,last_name=None,age=None): print(f"your first name is {first_name}") print(f"your first name is {last_name}") print(f"your first name is {age}") user_info() #if your not type anything the all defult valur is None and it show None in when user don't type anything #i try to put input command on def but its not working