Abhishek Sharma

Started my Data Science journey in my 2nd year of college and since then continuously into it because of the magical powers of ML and continuously doing projects in almost every domain of AI like MNL, DL, CV, NLP.

Machine Learning Projects

Python Program to Get File Creation and Modification Date – 2022

Hey guys, in this blog we will see a Python Program to Get File Creation and Modification Date. Example 1: Using the os module Output Last modification time: Wed Jan 19 10:34:31 2022 Last metadata change time or path creation time: Sun Oct 2 12:42:37 2022 Here we have used the os and time modules to get …

Python Program to Get File Creation and Modification Date – 2022 Read More »

Machine Learning Projects

Python Program to Find All Files with .txt Extension Present Inside a Directory – 2022

Hey guys, in this blog we will see a Python Program to Find All Files with .txt Extension Present Inside a Directory. Example 1: Using glob Output file3.txtfile2.txtfile1.txt Here we have used the glob() python package to get all the ‘.txt’ files. We have used glob.glob(“*.txt”) to get a list of all “.txt” files. Example 2: Using …

Python Program to Find All Files with .txt Extension Present Inside a Directory – 2022 Read More »

Machine Learning Projects

Python Program to Get the Line Count of a File – 2022

Hey guys, in this blog we will see a Python Program to Get the Line Count of a File. The content of the file my_file.txt is Machine Learning Projects Deep Learning Projects Computer Vision Projects Example 1: Using a for loop Output 3 Here we have just opened the file and used enumerate to count the number of lines …

Python Program to Get the Line Count of a File – 2022 Read More »

Machine Learning Projects

Python Program to Return Multiple Values From a Function – 2022

Hey guys, in this blog we will see a Python Program to Return Multiple Values From a Function. Example 1: Return values using a comma Output (‘Abhishek’, ‘Sharma’) Abhishek Sharma Here we have printed our returned values in two ways. In the first way, we have not unpacked our values hence a tuple is printed. Whereas in …

Python Program to Return Multiple Values From a Function – 2022 Read More »

Machine Learning Projects

Python Program to Represent enum – 2022

Hey guys, in this blog we will see a Python Program to Represent enum. Code Output Day.FEBRUARY FEBRUARY 2 Here we have used enum.ENUM to create a Day class. Day.FEBRUARY will give Day.FEBRUARY as the output. Day.FEBRUARY.name will give FEBRUARY as the output. Day.FEBRUARY.value will give 2 as the output. Check out our other python programming examples…

Machine Learning Projects

Python Program to Get the File Name From the File Path – 2022

Hey guys, in this blog we will see a Python Program to Get the File Name From the File Path. Example 1: Using the os module Output file Here we have used os.path.splitext(file_name)[0] to extract the file name from the path. We did the same for extracting the extension where we took the [1] element. …

Python Program to Get the File Name From the File Path – 2022 Read More »

Machine Learning Projects

Python Program to Trim Whitespace From a String – 2022

Hey guys, in this blog we will see a Python Program to Trim Whitespace From a String. Example 1: Using strip() Output Machine Learning Projects However, if you have characters in the string like ‘\n’ and you want to remove only the whitespaces, you need to specify it explicitly on the strip() method as shown in the following code. …

Python Program to Trim Whitespace From a String – 2022 Read More »

Machine Learning Projects

Python Program to Convert Two Lists Into a Dictionary – 2022

Hey guys, in this blog we will see a Python Program to Convert Two Lists Into a Dictionary. Example 1: Using zip and dict methods Output {1: ‘ml’, 2: ‘dl’, 3: ‘ai’} zip takes 2 lists and merges them element-wise. zip(index,domain) will make a list like [(1,’ml’),(2,’dl’),(3,’ai’)]. And then dict() method will create a dictionary …

Python Program to Convert Two Lists Into a Dictionary – 2022 Read More »

Machine Learning Projects

Python Program to Get the Class Name of an Instance – 2022

Hey guys, in this blog we will see a Python Program to Get the Class Name of an Instance. Example 1: Using __class__.__name__ Output Project We can use object.__class__.__name__ to get the class name of the object. Example 2: Using type() and __name__ attribute Output Project We can also use type(object).__name__ to get the class …

Python Program to Get the Class Name of an Instance – 2022 Read More »