Write a Python Program to Check If a List is Empty

Python Program to Check If a List is Empty

Welcome to the World of Online Learning:

Hello Friends “This blog helps you to learn  Python programming concepts. You can learn Python language at your own speed and time. One can learn concepts of Python language by practicing various programs given on various pages of this blog. Enjoy the power of Self-learning using the Internet.”

Python Program to Check If a List is Empty
Python Program to Check If a List is Empty

Write a Python Program to Check If a List is Empty

PROGRAM: Python Program to Check If a List is Empty

/* Python Program to Check If a List is Empty */

Using shutil module

from shutil import copyfile
copyfile("/root/a.txt", "/root/b.txt")

The first parameter of copyfile() is the path of the source file and the second parameter is the path of the destination file. The content of the destination file is replaced with the content of the source file.

There are other methods copy()cop2(), and copyfileobj() which serve the same purpose with some metadata changes.

Leave a Reply

Your email address will not be published. Required fields are marked *