logging warning logging info logging error we can also save the log messages into the file logging basicconfig(level=logging debugfilename 'logging log'now all log messages will go the file (logging login your current working directory instead of the screen this is much better approach as it lets us to do post analysis of the messages we got we can also set the date stamp with our log message logging basicconfig(level=logging debugformat '%(asctime) %(levelname) :%(message) 'output will get something like : : , debug:this message will be ignored : : , info:this should be logged : : , warning:and thistoo benchmarking benchmarking or profiling is basically to test how fast is your code executes and where the bottlenecks arethe main reason to do this is for optimization timeit python comes with in-built module called timeit you can use it to time small code snippets the timeit module uses platform-specific time functions so that you will get the most accurate timings possible soit allows us to compare two shipment of code taken by each and then optimize the scripts to given better performance the timeit module has command line interfacebut it can also be imported there are two ways to call script let' use the script firstfor that run the below code and see the output import timeit