Python Tutorial for Beginners 4: Lists, Tuples, and Sets

    2
    30



    In this Python Beginner Tutorial, we will begin learning about Lists, Tuples, and Sets in Python. Lists and Tuples allow us to work with sequential data, and Sets allow us to work with unordered unique values. We will go over most of the methods, learn when to use which data type, and also the performance benefits of each type as well. Let’s get started.

    The code from this video can be found at:
    https://github.com/CoreyMSchafer/code_snippets/tree/master/Python-Lists

    Watch the full Python Beginner Series here:

    Slicing Video: https://youtu.be/ajrtAuDg3yw

    āœ… Support My Channel Through Patreon:
    https://www.patreon.com/coreyms

    āœ… Become a Channel Member:
    https://www.youtube.com/channel/UCCezIgC97PvUuR4_gbFUs5g/join

    āœ… One-Time Contribution Through PayPal:
    https://goo.gl/649HFY

    āœ… Cryptocurrency Donations:
    Bitcoin Wallet – 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
    Ethereum Wallet – 0x151649418616068fB46C3598083817101d3bCD33
    Litecoin Wallet – MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

    āœ… Corey’s Public Amazon Wishlist
    http://a.co/inIyro1

    āœ… Equipment I Use and Books I Recommend:
    https://www.amazon.com/shop/coreyschafer

    ā–¶ļø You Can Find Me On:
    My Website – http://coreyms.com/
    My Second Channel – https://www.youtube.com/c/coreymschafer
    Facebook – https://www.facebook.com/CoreyMSchafer
    Twitter – https://twitter.com/CoreyMSchafer
    Instagram – https://www.instagram.com/coreymschafer/

    #Python

    source

    Previous article[PL] Ansible – Wprowadzenie – #3 Jak działa
    Next articleCara Boot dari USB di VMWare (Instal Ulang di Virtual Machine)

    30 COMMENTS

    1. def _init_ (self, text_file_name, positive_file_name, negative_file_name):
      self.file_name = text_file_name
      file_text = open ("{}".format (text_file_name), "r")
      self.text = file_text.read()
      file_text.close()
      with open("{}".format (positive_file_name)) as file:
      list_positive_words = file.readlines()

      the_positive_words = ""
      for line in list_positive_words:
      the_positive_words+=line.strip()
      the_positive_words+=" "

      self.positive_words = the_positive_words.split()
      self.positive_words.append ("")

      with open("{}".format (negative_file_name)) as file:
      list_negative_words = file.readlines()

      the_negative_words = ""
      for line in list_negative_words:
      the_negative_words+=line.strip()
      the_negative_words+=" "

      self.negative_words = the_negative_words.split()
      self.negative_words.append("")