Sequence_data_part_1
Summary
TLDRThe video script is a comprehensive tutorial on sequence data types in Python. It covers fundamental concepts like strings, lists, tuples, arrays, and sets, explaining their creation and manipulation. The script also delves into more complex data structures, demonstrating how to use functions like 'range' and 'dict' to generate sequences. It provides practical examples, such as creating a string with quotes and a list with numerical values, emphasizing the importance of sequence data types in Python programming.
Takeaways
- 😀 The lecture introduces the concept of sequential data types in Python.
- 📝 Sequential data types allow for the creation and manipulation of multiple values within a system.
- 🔡 Examples of sequential data types include strings, Unicode strings, lists, tuples, and collections.
- 💬 Strings in Python are ordered sequences of characters and can be created using single, double, or triple quotes.
- 📚 Lists are created using square brackets and can contain items of different data types, including numbers and strings.
- 🔑 Tuples are similar to lists but are immutable, meaning their contents cannot be changed after creation.
- 🗃️ Sets and dictionaries are mentioned as non-sequential data types that store unique elements and key-value pairs respectively.
- 🛠️ Arrays are discussed as a way to store collections of similar data types, often used for numerical data.
- 🔄 The lecture demonstrates the creation and manipulation of strings, lists, and arrays with examples.
- 🔍 The importance of understanding data types and their properties is emphasized for effective Python programming.
Q & A
What is the main topic of the lecture?
-The main topic of the lecture is sequential data types in programming, specifically focusing on their usage and examples in Python.
What are the basic sequential data types discussed in the lecture?
-The basic sequential data types discussed include strings, Unicode strings, lists, tuples, and collections such as arrays and object sequences.
How are strings defined in Python according to the lecture?
-Strings in Python are defined as an ordered sequence of characters, which can include letters, numbers, and symbols, and can be enclosed in single, double, or triple quotes.
What is a list in Python?
-A list in Python is a collection of items that are ordered and mutable, which means the items can be changed, and it can be defined using square brackets.
What is the difference between a list and a tuple in Python?
-The main difference is that a list is mutable, meaning its contents can be changed, while a tuple is immutable, meaning its contents cannot be altered once created.
What is an array in Python?
-An array in Python is a collection of objects stored in contiguous memory locations, and it is often used to store a collection of similar data types.
How are dictionaries created in Python?
-Dictionaries in Python are created using curly braces, where keys are paired with values, and the key-value pairs are separated by commas.
What is a set in Python?
-A set in Python is an unordered collection of distinct elements, which can be created using the set function or by placing elements within curly braces.
How can you create a range in Python?
-A range in Python can be created using the range function, which takes parameters such as start, stop, and step values to generate a sequence of numbers.
What is the purpose of loops in Python when working with sequential data?
-Loops in Python are used to iterate over sequential data types to perform operations on each element, and they are commonly used with structures like lists and tuples.
How can you print the elements of a list in Python?
-The elements of a list in Python can be printed using a for loop, which iterates through each element and prints it, or by using the print function with the list as an argument.
Outlines
📘 Introduction to Sequential Data Types
The script begins with a welcome and an introduction to the topic of sequential data types in programming. It emphasizes the importance of understanding these data types for creating and managing multiple values within a system. The paragraph outlines the basic concept of sequential data types, which allow for the creation and manipulation of ordered collections, such as strings, Unicode strings, lists, tuples, and objects. The discussion also briefly touches on non-sequential data types like sets and dictionaries. The paragraph sets the stage for exploring examples of sequential data types, starting with strings.
🔡 Delving into String Data Type
This paragraph focuses on the string data type, explaining it as an ordered sequence of characters that can include letters, numbers, and symbols. It can be static or dynamic. The paragraph demonstrates how to define a string in Python using single, double, or triple quotes and how strings can be used to represent and store sequences of characters. An example is given where the string 'STAMP' is created and printed, showcasing the process of string creation and manipulation. The paragraph also explains that lists, another sequential data type, can be created using square brackets and can contain multiple data types, including strings and objects.
📐 Exploring Lists and Arrays
The script moves on to discuss lists and arrays as sequential data types. Lists are mutable and can contain elements of different data types, while arrays are fixed-size and typically hold elements of the same data type. The paragraph explains how to create lists and arrays in Python, emphasizing the use of square brackets for lists and the array module for arrays. It also touches on the concept of tuples as immutable sequences and the use of functions to create and manipulate these data structures. The paragraph concludes with a demonstration of how to print the values of a list, showcasing the use of a for loop to iterate through the list.
Mindmap
Keywords
💡Sequence Data
💡String
💡List
💡Tuple
💡Array
💡Dictionary
💡Set
💡Range
💡Loop
💡Function
💡Data Type
Highlights
Introduction to sequential data types in the lecture.
Explanation of sequential data types allowing the creation or storage of multiple values in a systematic manner.
Mention of various data types like strings, Unicode strings, lists, tuples, and object sequences.
Discussion on non-sequential data types such as numbers, sets, and containers.
Example of creating a string in Python and its mutable nature.
Demonstration of how to print strings using the print function.
Introduction to lists as a sequential data type in Python.
Explanation of lists allowing multiple data types and their mutable nature.
Example of creating a list with numbers and strings.
Introduction to arrays as a collection of elements stored in contiguous memory locations.
Explanation of how to create arrays using the array module in Python.
Discussion on tuples as another sequential data type in Python.
Explanation of tuples being immutable and their use cases.
Introduction to dictionaries as a collection of key-value pairs.
Explanation of how to create dictionaries using curly braces or the dict function.
Discussion on sets as an unordered collection of unique elements.
Explanation of how to create sets using the set function or curly braces.
Introduction to the range function as a way to generate a sequence of numbers.
Example of using the range function to create a sequence with a specific step.
Transcripts
అందరికీ నమస్కారం, సీక్వెన్స్ డేటా
రకంపై ఉపన్యాసానికి స్వాగతం.
కాబట్టి, ఈ ఉపన్యాసంలో మనం సీక్వెన్స్ డేటా
రకంతో వ్యవహరించబోతున్నాం.
కాబట్టి, దానిలోకి ప్రవేశించే ముందు
సీక్వెన్స్ డేటా రకాలు ఏమిటో ప్రారంభిద్దాం.
ప్రాథమికంగా సీక్వెన్స్ డేటా రకం వ్యవస్థీకృత
వ్యవస్థలో బహుళ విలువలను సృష్టించడానికి
లేదా నిల్వ చేయడానికి మిమ్మల్ని అనుమతిస్తుంది.
మరియు సమర్థవంతమైన శైలి.
కాబట్టి అనేక క్రమాలు ఉన్నాయి, ఉదాహరణకు
స్ట్రింగ్, యూనికోడ్ స్ట్రింగ్స్ , జాబితాలు,
టపుల్స్ శ్రేణులు.
మరియు వస్తువుల శ్రేణి.
ఇతర రెండు డేటా రకాలను నిఘంటువులు మరియు
సెట్లు లేదా కంటైనర్లు అని పిలుస్తారు నాన్
సీక్వెన్షియల్ డేటా.
ఈ ఉపన్యాసంలో మనం అన్ని వరుస మరియు
నాన్ వరుస డేటా రకం కోసం ఉదాహరణలను చూడబోతున్నాము.
మొదట స్ట్రింగ్ డేటా రకం ఏమిటో చూద్దాం.
స్ట్రింగ్ అనేది ఒకటి లేదా అంతకంటే
ఎక్కువ అక్షరాల క్రమం, ఉదాహరణకు, ఇది అక్షరాలు,
సంఖ్యలను కలిగి ఉండవచ్చు.
మరియు చిహ్నాలు మరియు అవి స్థిరంగా లేదా
చరరాశిగా ఉండవచ్చు.
మరియు స్ట్రింగ్స్ ప్రాథమికంగా పైథాన్లో
మార్చగల క్రమం.
కాబట్టి, స్ట్రింగ్ను రూపొందించడానికి
మనం సింగిల్, డబుల్ లేదా ట్రిపుల్ కోట్స్
లోపల అక్షరాల క్రమాన్ని మూసివేయవచ్చు.
స్ట్రింగ్ను రూపొందించడానికి ఒక ఉదాహరణను చూద్దాం.
క్రియేట్ స్ట్రింగ్లో సింగిల్, డబుల్ లేదా
ట్రిపుల్ కోట్స్ లోపల అక్షరాల క్రమం
ఉంటుంది.
నేను ఎస్టీఆర్ శాంపిల్ అనే స్ట్రింగ్ను
సృష్టిస్తున్నాను మరియు ఇది అక్షరాల
క్రమాన్ని కలిగి ఉంటుంది నేర్చుకోవడం
మరియు నిల్వ చేయడం అనే పదాన్ని ఎస్టీఆర్
శాంపిల్ అని పిలువబడే రెండు చరరాశులపై
వివరిస్తుంది.
కాబట్టి అది ఒక స్ట్రింగ్ అవుతుంది.
కాబట్టి మనం ప్రింట్ ఫంక్షన్కు కాల్ చేయడం
ద్వారా స్ట్రింగ్ లను ప్రింట్ చేయవచ్చు.
కాబట్టి మనం స్ట్రింగ్ను ముద్రించినప్పుడు
ఎస్టీఆర్ శాంపిల్ అవుట్పుట్ కాల్ లెర్నింగ్ను
పొందుతుంది.
కాబట్టి ఎస్టీఆర్ శాంపిల్ ఇప్పుడు
ఒక స్ట్రింగ్.
కాబట్టి లిస్ట్ అని పిలువబడే తదుపరి
సీక్వెన్స్ డేటాకు వెళ్దాం.
కాబట్టి స్క్వేర్ బ్రాకెట్ల లోపల క్రమాన్ని
ఉంచడం ద్వారా పైథాన్లోని జాబితాను సృష్టించవచ్చు.
కాబట్టి, ఇక్కడ నేను లిస్నంబర్ అను ఒక
ఒక లిస్ట్ సృష్టిస్తున్నాను మరియు అది సంఖ్యలను
మాత్రమే కలిగి ఉంటుంది.
మరియు మీరు ఈ జాబితాలోని ఈ ఉదాహరణను పరిశీలిస్తే,
నాకు ప్రాథమికంగా పునరావృతమయ్యే ఒక
మూలకం ఉంది.
దీనికి నకిలీ విలువలు ఉన్నాయి.
ఎందుకంటే జాబితాలో వాటి విభిన్న స్థానాలతో
నకిలీ విలువలు ఉండవచ్చు మరియు అందువల్ల బహుళ
విలువలు ఉండవచ్చు.
ఈ విషయం లేదా నకిలీ విలువలను జాబితా
సృష్టించే సమయంలో క్రమం వలె పంపవచ్చు
స్వయంగా.
కాబట్టి ఇక్కడ లిస్నంబర్ అనేది సంఖ్యలను మాత్రమే
కలిగి ఉన్న లిస్సాంపుల్ మరియు దీనికి నకిలీ
విలువలు కూడా ఉన్నాయి.
దానికి.
కాబట్టి జాబితాను ప్రింట్ చేసి అవుట్పుట్
ఏమిటో చూద్దాం.
కాబట్టి మీరు ఇక్కడ అవుట్పుట్ను చూడగలుగుతారు,
దీనికి విలువలు 1,2,3,3,4 మరియు 5 ఉన్నాయి, కానీ
ఒక్కటే లిస్ట్ ఇంటిజర్స్ స్ట్రింగ్స్తో పాటు
ఆబ్జెక్ట్ వంటి డేటా రకాలను కలిగి ఉండవచ్చు.
కాబట్టి జాబితా బహుళ డేటా రకాల అంశాలను
కలిగి ఉండవచ్చు మరియు జాబితా కూడా మార్చగలదు
మరియు అందువల్ల అవి వాటిని సృష్టించిన
తర్వాత కూడా మార్చవచ్చు.
కాబట్టి ఇప్పుడు నేను మరొక జాబితా
కాల్ లిస్ట్ , ఎల్యెస్టీ శాంపిల్ రూపొందిస్తున్నాను,
ఇది సంఖ్యలు మరియు స్ట్రింగ్స్ రెండింటినీ
కలిగి ఉంటుంది.
కాబట్టి, ఉదాహరణకు 1,2, a, సామ్ మరియు అలాగే
ఇక్కడ 2, ఒక ఎల్యెస్టీ శాంపిల్ బహుళ డేటా
రకాలు ఉంటాయి.
దానిని ప్రింట్ చేసి చూద్దాం.
కాబట్టి జాబితాను ఉపయోగించడం వల్ల
కలిగే ఒక ప్రయోజనం ఏమిటంటే ప్రాథమికంగా
మీరు బహుళ డేటా రకానికి చెందిన అంశాలను కలిగి
ఉండవచ్చు.
కాబట్టి, తరువాత మనం అర్రే అనే మరొక
సీక్వెన్స్ డేటా కాల్ని పరిశీలిస్తాము
మరియు అర్రే అనేది ఏమీ కాదు.
ఇది పక్కపక్కనే ఉన్న మెమరీ ప్రదేశాలలో
నిల్వ చేయబడిన వస్తువుల సేకరణ.
మరియు ఒకే డేటా రకానికి చెందిన బహుళ అంశాలను
కలిసి నిల్వ చేయడానికి మనము శ్రేణిని ఉపయోగించవచ్చు
మరియు శ్రేణి మాడ్యూల్ను దిగుమతి చేయడం ద్వారా
పైథాన్లోని శ్రేణులను సృష్టించవచ్చు.
కాబట్టి అర్రే మాడ్యూల్ను దిగుమతి చేసుకుందాం,
కాబట్టి అర్రే నుండి నేను దానిని ఆస్టెరిక్స్గా
ముఖ్యమైనది నేను వాటిని కాల్ చేయకుండా
కూడా అర్రే నుండి ఒక ఫంక్షన్ను మాత్రమే
ఉపయోగించగలను.
మరియు వాక్యనిర్మాణం లేదా మనం అర్రే ఫంక్షన్ను
ఉపయోగించగల విధానం ఏమిటంటే మనం డేటా
రకాన్ని పేర్కొనాలి.
మరియు ఫంక్షన్ శ్రేణికి వాదనగా విలువ జాబితా.
కాబట్టి అర్రే ఫంక్షన్ను ఉపయోగించి అర్రేను
ఎలా సృష్టించాలో చూద్దాం.
పేర్కొన్న విధంగా మొదటి వాదనగా డేటా
రకం మరియు విలువలను ఇచ్చిన రెండవ వాదన
జాబితాగా మరియు ఆ అవుట్పుట్ను అర్రే
శాంపిల్ అని పిలువబడే వస్తువుగా నిల్వ
చేయండి.
కాబట్టి, ఇప్పుడు అర్రే యొక్క విలువలను
ప్రింట్ చేసి చూద్దాం.
కాబట్టి ఇక్కడ నేను అర్రే శాంపిల్ యొక్క
విలువలను ముద్రించడానికి ఫర్ లూప్ ఉపయోగిస్తున్నాను.
కాబట్టి, మీరు మీ శ్రేణి పేరు యొక్క
ముద్రణను మాత్రమే ఉపయోగిస్తే, మీరు
ముద్రణ ఫంక్షన్ను ఉపయోగిస్తే అది కేవలం
మీరు ఇచ్చే అదే ఇన్పుట్ను మీకు ఇవ్వబోతున్నాను
కానీ మీరు విలువలను ముద్రించాలనుకుంటే,
అప్పుడు మీరు మీ శ్రేణి యొక్క విలువలను
పొందడానికి ఫర్ లూప్ను ఉపయోగించవచ్చు.
కాబట్టి, ప్రాథమికంగా మొదటి ఇట్రేషన్ లో
మొదటి విలువను ప్రింట్ చేయబోతోంది మరియు
లూప్ కోసం వెళుతుంది తదుపరి శీర్షిక వరకు.
కాబట్టి ఇది మీ శ్రేణి నమూనాలోని అన్ని
విలువలను ముద్రించబోతోంది.
ఇప్పుడు మనకు విలువలు వచ్చాయి.
కాబట్టి విలువలు 1,2,3 మరియు 4.
కాబట్టి ఈ విధంగా మనము ఒక శ్రేణిని
సృష్టిస్తాము.
మీరు ఇప్పుడు సృష్టించిన శ్రేణి కేవలం ఒక
డైమెన్షనల్ శ్రేణి అని మీరు ఇక్కడ చూడగలిగినట్లుగా,
మేము చేస్తాము రాబోయే సెషన్లో బహుమితీయ
శ్రేణిని ఎలా సృష్టించాలో లేదా ఎలా వ్యవహరించాలో
చూడండి.
కాబట్టి ఇక్కడ నేను ఇచ్చిన పూర్ణాంకాన్ని
సూచించడానికి డేటా రకాన్ని పూర్ణాంకంగా
పేర్కొంటాను, మీరు వివిధ డేటా రకాలతో
శ్రేణిని సృష్టించాలనుకుంటే, అప్పుడు మీరు సంజ్ఞామానాన్ని
ఉపయోగించవచ్చు వివిధ రకాల డేటాను సూచించడానికి.
కాబట్టి ఇక్కడ క్రింద పేర్కొన్న డేటా రకాలను
వివిధ రకాల శ్రేణిని రూపొందించడంలో ఉపయోగించవచ్చు.
కాబట్టి, నేను పైథాన్ రకాన్ని సూచించడానికి
ఇక్కడ కోట్ ఇచ్చాను మరియు కనీస బైట్ల
సంఖ్య.
ఉదాహరణకు, మీరు డేటా టైప్ ఫ్లోట్ తో ఒక
శ్రేణిని సృష్టించాలనుకుంటే, అప్పుడు మీరు ఉపయోగించవచ్చు
కోడ్ f. కాబట్టి, తదుపరిది టుపుల్కు వెళదాం
, అది కూడా సీక్వెన్స్ డేటా రకంలో ఒకటి.
పైథాన్లోని టుపుల్ ఒక జాబితాను పోలి
ఉంటుంది, కానీ రెండింటి మధ్య వ్యత్యాసం ఏమిటంటే
మనం టుపుల్ యొక్క మూలకాలను కేటాయించిన
తర్వాత వాటిని మార్చలేము , అయితే జాబితాలో
మూలకాలను మార్చవచ్చు పైథాన్లో పేరెంథెసిస్
లోపల అన్ని మూలకాలను ఉంచడం ద్వారా సృష్టించబడిన
టపుల్స్ కామాలతో వేరు చేయబడతాయి.
మరియు నేను అన్ని విలువలు లేదా మూలకాలను
కామాలతో వేరు చేస్తున్నాను.
మరియు టుపుల్ ఎన్ని అంశాలనైనా కలిగి
ఉండవచ్చు మరియు అవి వివిధ డేటా రకాలుగా
ఉండవచ్చు మరియు ఇక్కడ నేను ఇప్పుడు సృష్టిస్తున్న
టుపుల్కు పూర్ణాంకం మరియు స్ట్రింగ్
ఉన్నాయి మరియు టుపుల్ కూడా చేయవచ్చు కుండలీకరణాన్ని
కూడా ఉపయోగించకుండా సృష్టించవచ్చు మరియు
దీనిని టుపుల్ ప్యాకింగ్ అంటారు.
కాబట్టి ఇక్కడ మీకు చూపించడానికి నా
దగ్గర ఒక ఉదాహరణ ఉంది.
కాబట్టి ఇక్కడ నేను టుపుల్ సృష్టించడానికి
కుండలీకరణాన్ని ఉపయోగించలేదు కానీ
నాకు విలువలు మాత్రమే ఇవ్వబడ్డాయి కామాలతో
వేరు చేయబడింది.
కాబట్టి మీరు మీ టుపుల్ విలువ యొక్క
విలువలను ముద్రిస్తే, అది ఇలా ఉంటుంది.
కాబట్టి మేము టుపుల్ ప్యాకింగ్ అని పిలిచాము.
కాబట్టి తదుపరిది నిఘంటువు యొక్క నిఘంటువు
సృష్టి, దీని కోసం మనం ఇలా ఒక నిఘంటువును
సృష్టించాము . నిఘంటువును ఎలా సృష్టించాలో
చూసే ముందు నిఘంటువు అంటే ఏమిటో మీకు
చెప్తాను.
కాబట్టి పైథాన్లోని నిఘంటువు అనేది డేటా
విలువల క్రమబద్ధీకరించని సేకరణ, ఇది డేటామ్యాప్
వంటి విలువలు నిల్వ చేయడానికి ఉపయోగించబడుతుంది.
ఒక మూలకంలో ఒకే విలువలను మాత్రమే కలిగి ఉన్న
ఇతర డేటా రకాల మాదిరిగా కాకుండా.
నిఘంటువు కీలక విలువ జతలను కలిగి ఉంటుంది.
కాబట్టి నిఘంటువు మరింత అనుకూలమైనదిగా
చేయడానికి నిఘంటువులో అందించిన ముఖ్య విలువలు.
కాబట్టి పైథాన్ నిఘంటువులో కర్లీ బ్రాకెట్స్
లోపల మూలకాల క్రమాన్ని ఉంచడం ద్వారా సృష్టించవచ్చు.
ఇలాంటి కలుపులు మరియు మీరు మీ కీ విలువ
జతలను కామా మరియు నిఘంటువు ద్వారా
వేరు చేయవచ్చు ఇది ఒక జత విలువలను కలిగి
ఉంటుంది.
ఉదాహరణకు ఇది ఒక జత విలువలు, ఒకటి
కీ మరియు మరొకటి సంబంధిత జత మూలకం
దాని ప్రధాన విలువ.
కాబట్టి ఇక్కడ ఒకటి కీలకం మరియు ఇక్కడ
కీలక విలువ మొదటిది మరియు నిఘంటువులోని
విలువలు ఏదైనా డేటా రకం మరియు అలాగే
నకిలీ చేయవచ్చు.
కానీ మీరు ప్రత్యేకమైన కీలను మాత్రమే కలిగి
ఉండవచ్చు, కానీ మీరు నకిలీ విలువలను కలిగి
ఉండవచ్చు.
కాబట్టి మనము నిఘంటువును ఎలా సృష్టిస్తాము
కాబట్టి ఇప్పుడు నిఘంటువుగా నమూనాను
నిర్దేశించండి.
ఖాళీ నిఘంటువు అని డిక్ట్ ఉపయోగించి
అంతర్నిర్మిత ఫంక్షన్ ద్వారా కూడా నిఘంటువును
సృష్టించవచ్చు.
గిరజాల కలుపుల లోపల మూలకాలను ఉంచడం ద్వారా
సృష్టించవచ్చు.
కానీ మీరు నిఘంటువును రూపొందించడానికి
డిస్ట్ ఫంక్షన్ను కూడా ఉపయోగించవచ్చు.
కాబట్టి ఇక్కడ నేను డిక్ట్ అంతర్నిర్మిత
ఫంక్షన్ ఉపయోగించి అదే నిఘంటువులను
సృష్టిస్తున్నాను.
కాబట్టి నాకు టుపుల్గా కీలక విలువలు ఇవ్వబడ్డాయి.
కాబట్టి, ప్రతి సెట్ కీలక విలువ జతలుగా
ఎంపిక చేయబడుతుంది.
మీరు డిక్ట్ను ప్రింట్ చేస్తే, మీరు నిఘంటువును
ప్రింట్ చేస్తే, మీకు కీలు మరియు
విలువలు లభిస్తాయి.
సెట్ సీక్వెన్స్ రకం ప్రాథమికంగా
సెట్లు కలిగి ఉండవచ్చు వివిధ అంశాలను కలిగి
ఉండవచ్చు, ఆర్డర్ ఒక సమితిలోని మూలకాల
సంఖ్య నిర్వచించబడలేదు.
ఏదైనా మార్పులేని డేటా రకం సమితి యొక్క
ఒక మూలకం కావచ్చు.
కాబట్టి ఇక్కడ నేను స్ట్రింగ్, పూర్ణాంకాన్ని
సెట్ యొక్క మూలకాలుగా ఉపయోగిస్తున్నాను,
ఉదాహరణకు ఒక సంఖ్య స్ట్రింగ్ ఒక టూపుల్.
ఇక్కడ నేను స్ట్రింగ్ మరియు సంఖ్యలను ఉపయోగిస్తున్నాను.
కాబట్టి ఇక్కడ నాకు ఒక ఉదాహరణ ఉంది.
ఇక్కడ గమనించదగ్గ విషయం ఏమిటంటే జాబితా
అనేది సమితి యొక్క మూలకం కాకూడదు.
మేము నిఘంటువు కోసం ఇచ్చినట్లుగా మరియు
నిఘంటువును రూపొందించడానికి మూలకాలను జాబితాగా
పాస్ చేసాము, కానీ సమితిని సృష్టించడానికి
అలా చేయలేము ఎందుకంటే ఇది సమితి యొక్క
మూలకం కాదు.
మరియు మరొకటి కూడా ఒక సమితి యొక్క మూలకం
కాకపోవచ్చు.
కాబట్టి మీరు ఒక సమితిని ఉపయోగించి
ఒక సమితిని సృష్టించలేరు, మీరు దానిని ఒక మూలకంగా
కలిగి ఉండలేరు.
మీరు ఒక సమితిని దాని అన్ని మూలకాలను
బ్రాకెట్లలో అర్థం చేసుకోవడం ద్వారా
సరళంగా నిర్వచించవచ్చు.
కాబట్టి మీరు ఒక సమితిని సృష్టించడానికి
అదే గిరజాల బ్రాకెట్లను ఉపయోగించవచ్చు లేదా
మీరు ఫంక్షన్ను కూడా ఉపయోగించవచ్చు దీనిని
అంతర్నిర్మిత సెట్ అని పిలుస్తారు,
కాబట్టి మీరు సెట్ను సృష్టించడానికి
సెట్ ఫంక్షన్ను కూడా ఉపయోగించవచ్చు.
కాబట్టి, ఫంక్షన్ల సమితిని ఉపయోగించి
సృష్టించగల ఖాళీ సమితి మాత్రమే మినహాయింపు.
కాబట్టి మీరు సెట్ ఫంక్షన్ను ఉపయోగిస్తున్నట్లయితే,
మీరు జాబితా, స్ట్రింగ్ లేదా టుపుల్ను పరామితిగా
ఉపయోగించాలి.
కాబట్టి ఇది దాని మూలకాలతో కూడిన సమితిని
తిరిగి ఇస్తుంది.
ఉదాహరణకు, నేను ఇక్కడ ఒక సమితిని సృష్టిస్తున్నాను.
కాబట్టి మీరు దానిని ప్రింట్ చేస్తే సెట్
వాస్తవానికి దాని ఎలిమెంట్లను కలిగి
ఉంటుంది.
కాబట్టి మీరు సెట్ ఫంక్షన్ను ఉపయోగించి
సెట్ను ఎలా సృష్టించారు.
కాబట్టి మనం ఇక్కడ చూడగలిగే తదుపరి
విషయం శ్రేణి, ఇది సీక్వెన్స్ డేటా
రకం కూడా.
పైథాన్ మరియు రేంజ్లో, ఇది పైథాన్ యొక్క
అంతర్నిర్మిత ఫంక్షన్.
కాబట్టి మీరు నిర్దిష్ట సమయం వరకు ఏదైనా
చర్య చేయాలనుకున్నప్పుడల్లా దాన్ని ఉపయోగించవచ్చు
మరియు ఇది సాధారణంగా లూపింగ్ కోసం ఉపయోగించబడుతుంది,
అందువల్ల మీకు కావలసినప్పుడు అదే కీలక అంశం గురించి
జ్ఞానం ఉంటుంది.
ఏ రకమైన పైథాన్ కోడింగ్తోనైనా వ్యవహరించడానికి.
ప్రాథమికంగా శ్రేణి ఫంక్షన్ మూడు వాదనలను
తీసుకుంటుంది.
మొదటి వాదన అనేది పూర్ణాంకాల క్రమం
నుండి ప్రారంభమయ్యే పూర్ణాంకాలతో ప్రారంభ
విలువ వ్రాయాలి.
తదుపరి విలువ స్టాప్ విలువ.
కాబట్టి మీరు 12 ఇస్తే, దానికి ముందు మీకు
n మైనస్ 1 విలువ లభిస్తుంది.
కాబట్టి మీరు 12 కి ముందు విలువను పొందుతారు,
అంటే 11.
చివరి వాదన మీరు ఒక పూర్ణాంకాన్ని
ఇవ్వగల స్టాప్ విలువ, దీనికి ముందు క్రమం
ఉంటుంది.
పూర్ణాంకాలు వ్రాయబడాలి.
కాబట్టి చూద్దాం.
నేను 1,12,4 ఇస్తున్నాను.
కాబట్టి నేను 1 నుండి 12 వరకు విలువ యొక్క
క్రమాన్ని సృష్టించబోతున్నాను.
నేను దశ పరిమాణం 4 ఇచ్చినందున మీరు
అవుట్పుట్ను 0.5 మరియు 9 గా పొందుతారు.
పరిధి ఎలా ఉంటుంది అంటే శ్రేణి ఫంక్షన్
ఎలా పనిచేస్తుంది.
కాబట్టి ఇక్కడ కూడా నేను పరిధి విలువలను
ముద్రించడానికి లూప్ కోసం ఉపయోగిస్తున్నాను.
మీరు విలువలను పొందడానికి ప్రింట్ ఫంక్షన్ను
మాత్రమే ఉపయోగిస్తే, మీరు మీ విలువ యొక్క
ఇన్పుట్ను పొందుతారు.
కాబట్టి ఈ ఉపన్యాసంలో సీక్వెన్స్ డేటా
రకాలు ఏమిటి, ఆపై మనం కొన్నింటిని
కూడా చూశాము.
డేటాను నిల్వ చేయడానికి కంటైనర్లుగా ఉపయోగించగల
క్రమం డేటా రకం.
వాటిలో కొన్ని స్ట్రింగ్స్ , టపుల్స్, జాబితాలు,
శ్రేణులు, నిఘంటువు సెట్లు మరియు పరిధి
మరియు మనకు కూడా ఉన్నాయి అన్ని క్రమం
డేటా రకానికి వస్తువును ఎలా ప్రారంభించాలో
ఎలా సృష్టించాలో చూశారు.
రాబోయే ఉపన్యాసాలలో ప్రతిదానిపై కొన్ని
కార్యకలాపాలను ఎలా నిర్వహించాలో చూద్దాం.
ధన్యవాదాలు .
浏览更多相关视频
DATA TYPES in Python (Numbers, Strings, Lists, Dictionary, Tuples, Sets) - Python for Beginners
Sequence data part 3
Variables and Data Types | Python Tutorial - Day #6
What are Data Types in Python | All Data Types | Tutorial For Beginners
Day 2 : Python Installation, Variables, Datatypes | Python Course in Telugu | Vamsi Bhavani
Variables and Datatypes
5.0 / 5 (0 votes)