1"""
2Use os.path.isfile(some_string) to check if some_string is a file
3Use os.path.isdir(some_string) to check if some_string is a directory
4"""
5import os
6
7path = "C:/some directory/"
8file = path + "file.txt"
9
10print("variable path is a file:", os.path.isfile(path) )
11print("variable path is a directory:", os.path.isdir(path) )
12
13print()
14
15print("variable file is a file:", os.path.isfile(file) )
16print("variable file is a directory:", os.path.isdir(file) )