GoConqr has a new look! Let us know what you think.

Flashcards

Python

Dwyt Dwyt English 3 cards

Python

Cards in this deck (3)

  1. 1How do you add an item to a list in Python?listname.append("item to add")
    listname.insert(index position, "item to add")
    1. append(): Adds the item to the end of the list.
    2. insert(): Allows you to add the item at a specific index.
  2. 2How do you remove an item from a set in Python?setname.remove("value na ireremove")
    setname.discard("value na ireremove")
    setname.pop()
    1.remove(): Removes the specified value. Raises an error if the value is not found.
    2. discard(): Removes the specified value without raising an error if the value isn't found.
    3. pop(): Removes the first item
  3. 3How do you access a value from a dictionary using a key in Python?print(dictionaryname[key])How do you access a value from a dictionary using a key in Python?

Information

Description
Flashcards on Python, created by Dwyt Dwyt on 10/10/2024.
Created by
Dwyt Dwyt
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?