Skip to content

Instantly share code, notes, and snippets.

View raveensrk's full-sized avatar

Raveen Kumar raveensrk

  • Uhnder Inc.
  • India
View GitHub Profile
@raveensrk
raveensrk / note.md
Created August 30, 2023 12:30
In python, what is the difference between extend() and append() methods?

Both extend() and append() are methods used to add elements to a list in Python, but they behave differently.

  1. append(): This method is used to add a single element to the end of a list.
my_list = [1, 2, 3]
my_list.append(4)
print(my_list)  # Output: [1, 2, 3, 4]
@raveensrk
raveensrk / append_a_list_to_list.md
Created August 30, 2023 12:33
In python, How to append one list to another list?

You can append the new_options list to another list using the extend() method or the += operator. Here's how you can do it:

# Your new_options list
new_options = [
    {
        "shortname": "-clean",
        "help": "Cleans run directory",
        "required": True,
 "default": False,