У нас вы можете посмотреть бесплатно Lists in Python | List Creation, Operations & Applications | 1st Year Computer | Chapter 4 | Lec 01 или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Social Media Links: _____/❤ All Students are requested to Follow Me on Social Media!! ❤\_______ Instagram:➜ / digitaleduc. . Twitter:➜ / shahbaz_ali101 Facebook Page:➜ / digitaleduca. . Whatsapp:➜ https://chat.whatsapp.com/GqLGyGuZyNp... Youtube:➜ https://bit.ly/32hA7C4?sub_confirmati... Introduction In this chapter, we will explore key computational structures, such as lists, stacks, queues, trees, and graphs, which are fundamental in programming. We will examine their properties, operations, and how to implement them efficiently. Additionally, we will discuss selecting the appropriate structure based on specific problem requirements and demonstrate their application in real-world scenarios. 4.1 Primitive Computational Structures There are following commonly used computational software: 4.1.1 Lists A list is a data structure used to store multiple pieces of data in a specific sequence. Each piece of data, known as an element, is positioned at a particular index within the list, facilitating easy access and management. 4.1.1.1 List Creation In Python, Lists are created using square brackets '[]', with each item separated by a comma.57 Create a list of items items= [ "Decorations" , "Snacks" , “cold drinks", "Plates", ”Balloon”] Print the list print(items) In the above code:“Items” is the name of the list. The items inside the list are “Decorations”, “Snacks”, “Cold drinks”, “Plates”, and “Balloons”. Each item is enclosed in quotes (for text) and separated by a comma. 4.1.1.2 List Properties List has following properties: 1. Dynamic Size A list in Python can change its size. You can add new items to the list or remove items without any problem. The list will automatically adjust to fit the changes. 2. Index-Based Access Every item in a list has a position, called an index. The first item has an index of 0, the second item has an index of 1, and so on. You can use these indexes to get specific items from the list. 3. Ordered Collection the order in which you add items to a list is preserved. This means that if you add an item first, it will stay in that position unless you change it. 4.1.1.3 List Operations: Some common operations of a list are: 1. Insertion: Adding a new item to your list is like adding a new task to your to-do list. You can insert an item at different positions in the list. You can insert an item at any position in the list using the 'insert( )' function.party_list = ["Buy drinks”, “Buy decorations", "Buy snacks", “Buy cold drinks "] party_list.insert (0 ,“Invite friends”) add Invite friends at startprint(party_list) Output: ["Buy drinks, “Buy decorations", "Buy snacks", “Buy cold drinks "] 2. Deletion: Removing an item from your list is like crossing off a task you've Completed. You can remove items in various ways a. Removing by Value: Use the 'remove()' function to delete the first occurrence of a specific item. party_list = ["Invite friends ","Buy decorations”, "Buy snacks”, "Buy cold drinks"] party_list.remove ("Buy snacks”) # Removes ’Buy snacks’ from the list print(party_list) Output: [’Invite friends’, ’Buy decorations’, ’Buy cold drinks ’] b. Removing by Index: Use the 'popO' function to remove an item at a specific index. party_list = ["Invite friends ", "Buy decorations", "Buy cold drinks” ] party_list.pop (0) # Removes the item at index 0 print(party_list) Output: [’Buy decorations’, ’Buy cold drinks’] 3. Searching: Finding an item in a list is similar to looking for a specific task in your to-do list. You can search for an item using different functions: Use the 'in' keyword to check if an item exists in the list.party_list = ["Invite friends", "Buy decorations", "Buy cold drinks" ]if "Buy cold drinks" in party_list: print("Buy cold drinks is on the list.") Prints if 'Buy cold drinks' is found else:print ("Buy cold drinks is not on the list.") Output: Buy cold drinks is on the list. 4.1.1.4 Applications of Lists• Data Storage and Manipulation: Lists are commonly used to store and manage collections of data, such as records, entries, or values. They allow for easy insertion, deletion, and access to elements. Stack and Queue Implementations: Lists can be used to implement stack (LIFO) and queue (FIFO) data structures, which are fundamental for various algorithms and tasks in computing. #DigitalEducation #DigitalEducationLatestNews #DigitalEducationShahbazAli #11thComputerScience2025 #ComputerScience2025 #FScComputerScience #1stYearComputerScience #ComputerScienceLectures #CSPakistan #CSForBeginners #FScPart1 #CSTutorials #DigitalEducation #Python #Lists #PythonProgramming #ComputerScience #Class11 #DigitalEducation #PythonTutorial #DataStructures #CodingForBeginners #PythonBasics Computer Science 11th class Lecturer of Computer Science By Sir Shahbaz Ali For any query or private tutoring contact (0309-0334424) shahbazalicp@gmail.com