Hướng dẫn what are the numerical data types in python? - các kiểu dữ liệu số trong python là gì?

Các loại dữ liệu là phân loại hoặc phân loại các mục dữ liệu. Nó đại diện cho loại giá trị cho biết những hoạt động có thể được thực hiện trên một dữ liệu cụ thể. Vì mọi thứ là một đối tượng trong lập trình Python, các loại dữ liệu thực sự là các lớp và biến là ví dụ (đối tượng) của các lớp này.

Sau đây là loại dữ liệu tiêu chuẩn hoặc tích hợp của Python:

  • Số
  • Loại trình tự
  • Boolean
  • Bộ
  • Từ điển

Hướng dẫn what are the numerical data types in python? - các kiểu dữ liệu số trong python là gì?

Số

Loại trình tự

  • Boolean– This value is represented by int class. It contains positive or negative whole numbers (without fraction or decimal). In Python there is no limit to how long an integer value can be.
  • Bộ– This value is represented by float class. It is a real number with floating point representation. It is specified by a decimal point. Optionally, the character e or E followed by a positive or negative integer may be appended to specify scientific notation.
  • Từ điển – Complex number is represented by complex class. It is specified as (real part) + (imaginary part)j. For example – 2+3j

Trong Python, loại dữ liệu số đại diện cho dữ liệu có giá trị số. Giá trị số có thể là số nguyên, số nổi hoặc thậm chí các số phức tạp. Các giá trị này được định nghĩa là

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
3,
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
4and
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
5Class trong Python.
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
6 function is used to determine the type of data type.

Python3

Số nguyên - Giá trị này được biểu thị bằng lớp Int. Nó chứa các số toàn bộ dương hoặc âm (không có phân số hoặc thập phân). Trong Python, không có giới hạn về giá trị số nguyên có thể là bao lâu.

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
2
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
4
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
5

Float - Giá trị này được biểu thị bằng lớp float. Đó là một con số thực với biểu diễn điểm nổi. Nó được chỉ định bởi một điểm thập phân. Tùy chọn, ký tự E hoặc E theo sau là số nguyên dương hoặc âm có thể được thêm vào để chỉ định ký hiệu khoa học.

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
4
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
4

Số phức - Số phức được thể hiện bằng lớp phức tạp. Nó được chỉ định là (phần thực) + (phần tưởng tượng) j. Ví dụ: 2+3J

Lưu ý - Hàm

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
6 được sử dụng để xác định loại loại dữ liệu.

Output:

Type of a:  

Type of b:  

Type of c:  

Loại trình tự

Boolean

  • Bộ
  • Từ điển
  • Trong Python, loại dữ liệu số đại diện cho dữ liệu có giá trị số. Giá trị số có thể là số nguyên, số nổi hoặc thậm chí các số phức tạp. Các giá trị này được định nghĩa là
    String with the use of Single Quotes: 
    Welcome to the Geeks World
    
    String with the use of Double Quotes: 
    I'm a Geek
    
    
    String with the use of Triple Quotes: 
    I'm a Geek and I live in a world of "Geeks"
    
    
    Creating a multiline String: 
    Geeks 
                For 
                Life
    
    3,
    String with the use of Single Quotes: 
    Welcome to the Geeks World
    
    String with the use of Double Quotes: 
    I'm a Geek
    
    
    String with the use of Triple Quotes: 
    I'm a Geek and I live in a world of "Geeks"
    
    
    Creating a multiline String: 
    Geeks 
                For 
                Life
    
    4and
    String with the use of Single Quotes: 
    Welcome to the Geeks World
    
    String with the use of Double Quotes: 
    I'm a Geek
    
    
    String with the use of Triple Quotes: 
    I'm a Geek and I live in a world of "Geeks"
    
    
    Creating a multiline String: 
    Geeks 
                For 
                Life
    
    5Class trong Python.

Số nguyên - Giá trị này được biểu thị bằng lớp Int. Nó chứa các số toàn bộ dương hoặc âm (không có phân số hoặc thập phân). Trong Python, không có giới hạn về giá trị số nguyên có thể là bao lâu.

Float - Giá trị này được biểu thị bằng lớp float. Đó là một con số thực với biểu diễn điểm nổi. Nó được chỉ định bởi một điểm thập phân. Tùy chọn, ký tự E hoặc E theo sau là số nguyên dương hoặc âm có thể được thêm vào để chỉ định ký hiệu khoa học.
 

Số phức - Số phức được thể hiện bằng lớp phức tạp. Nó được chỉ định là (phần thực) + (phần tưởng tượng) j. Ví dụ: 2+3J

Lưu ý - Hàm

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
6 được sử dụng để xác định loại loại dữ liệu.

Python3

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
7
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
9

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
2
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
5

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
6
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
8

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
First element of tuple
1

Last element of tuple
5

Third last element of tuple
3
1
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
5

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
4
First element of tuple
1

Last element of tuple
5

Third last element of tuple
3
8

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
7
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
5
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
7
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
8
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
9

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
5

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
4
First element of tuple
1

Last element of tuple
5

Third last element of tuple
3
8

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
7
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Traceback (most recent call last):
  File "/home/7e8862763fb66153d70824099d4f5fb7.py", line 8, in 
    print(type(true))
NameError: name 'true' is not defined
5
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
5

Output:

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
2
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
4
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
5

Trong Python, trình tự là bộ sưu tập có thứ tự của các loại dữ liệu tương tự hoặc khác nhau. Trình tự cho phép lưu trữ nhiều giá trị theo kiểu có tổ chức và hiệu quả. Có một số loại trình tự trong Python -

Hướng dẫn what are the numerical data types in python? - các kiểu dữ liệu số trong python là gì?

Python3

Sợi dây

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank Set: 
set()

Set with the use of String: 
{'F', 'o', 'G', 's', 'r', 'k', 'e'}

Set with the use of List: 
{'Geeks', 'For'}

Set with the use of Mixed Values
{1, 2, 4, 6, 'Geeks', 'For'}
4
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
5

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
00
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
03
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
04
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
05

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
08
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
03
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
12
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
05

Output:

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s

Danh sách– To know more about strings, refer Python String.

Tuple

1) Chuỗi
 

Trong Python, các chuỗi là các mảng byte đại diện cho các ký tự Unicode. Một chuỗi là một tập hợp của một hoặc nhiều ký tự được đặt trong một trích dẫn, trích dẫn kép hoặc ba. Trong Python không có kiểu dữ liệu ký tự, một ký tự là một chuỗi độ dài. Nó được đại diện bởi ________ 46 class. & Nbsp;

Tạo chuỗi

Python3

Chuỗi trong Python có thể được tạo bằng cách sử dụng trích dẫn đơn hoặc trích dẫn đôi hoặc thậm chí trích dẫn ba.

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
21
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
7
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
9

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
34
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
7
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
8

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1


3
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
29
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
04
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
58

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
29
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
7
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
05

Truy cập các thành phần của chuỗi

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
76
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Output:

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]

Trong Python, các ký tự riêng lẻ của chuỗi có thể được truy cập bằng cách sử dụng phương pháp lập chỉ mục. Lập chỉ mục cho phép tham chiếu địa chỉ âm đến các ký tự truy cập từ phía sau chuỗi, ví dụ: -1 đề cập đến nhân vật cuối cùng, -2 đề cập đến nhân vật cuối cùng thứ hai, v.v.

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
7
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial blank Set: 
set()

Set with the use of String: 
{'F', 'o', 'G', 's', 'r', 'k', 'e'}

Set with the use of List: 
{'Geeks', 'For'}

Set with the use of Mixed Values
{1, 2, 4, 6, 'Geeks', 'For'}
1

Python3

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
29
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
43
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
45
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
43__

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
96
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

_______

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
29
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
7
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
05

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
12
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
29
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
12
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
05

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
16
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
29
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
12
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
26
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
05

Output:

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks

Lưu ý - Để biết thêm về danh sách, hãy tham khảo danh sách Python.– To know more about Lists, refer Python List.

3) Tuple

Giống như danh sách, Tuple cũng là một bộ sưu tập các đối tượng Python được đặt hàng. Sự khác biệt duy nhất giữa tuple và danh sách là các bộ dữ liệu là bất biến, tức là các bộ dữ liệu không thể được sửa đổi sau khi nó được tạo ra. Nó được đại diện bởi ________ 228 Class. & Nbsp;
 

Tạo tuple

Trong Python, các bộ dữ liệu được tạo ra bằng cách đặt một chuỗi các giá trị được phân tách bằng ‘dấu phẩy có hoặc không sử dụng dấu ngoặc đơn để nhóm chuỗi dữ liệu. Tuples có thể chứa bất kỳ số lượng phần tử và của bất kỳ kiểu dữ liệu nào (như chuỗi, số nguyên, danh sách, v.v.).

Lưu ý: Bộ dữ liệu cũng có thể được tạo với một phần tử duy nhất, nhưng nó hơi khó khăn. Có một yếu tố trong dấu ngoặc đơn là không đủ, phải có một dấu vết dấu vết để biến nó thành một tuple. Tuples can also be created with a single element, but it is a bit tricky. Having one element in the parentheses is not sufficient, there must be a trailing ‘comma’ to make it a tuple.

Python3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
29
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
31

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
34
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
37

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
29
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
68
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
70
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
47
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
37

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
51
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
29
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
7
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3__

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
66
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
70
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
71

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
29
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
70
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
68
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
80
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
37

Các

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
95
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
98
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
00
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
02
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
04

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
07
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
10

Output:

Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))

Lưu ý - Tạo ra tuple python mà không sử dụng dấu ngoặc đơn được gọi là đóng gói tple.– Creation of Python tuple without the use of parentheses is known as Tuple Packing.

Truy cập các yếu tố của tuple

Để truy cập các mục Tuple, hãy tham khảo số chỉ mục. Sử dụng toán tử chỉ mục

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
82 để truy cập vào một mục trong một tuple. Chỉ số phải là một số nguyên. Các bộ dữ liệu lồng nhau được truy cập bằng cách sử dụng lập chỉ mục lồng nhau.

Python3

Is

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
28
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
29

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
31
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
04
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
25

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
36
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
29

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
31
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
12
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
25

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
45
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
29

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
31
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
12
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
26
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
25

Output:

First element of tuple
1

Last element of tuple
5

Third last element of tuple
3

Lưu ý - Để biết thêm về các bộ dữ liệu, hãy tham khảo các bộ dữ liệu python.– To know more about tuples, refer Python Tuples.

Boolean

Kiểu dữ liệu với một trong hai giá trị tích hợp,

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
52or
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
53. Các đối tượng Boolean bằng với sự thật là sự thật (đúng) và những đối tượng bằng sai là giả (sai). Nhưng các đối tượng không phải là Boolean cũng có thể được đánh giá trong bối cảnh Boolean và được xác định là đúng hoặc sai. Nó được ký hiệu là lớp
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
54.

Lưu ý - Đúng và Sai với vốn ’T, và F, là Booleans hợp lệ nếu không Python sẽ gây ra lỗi.– True and False with capital ‘T’ and ‘F’ are valid booleans otherwise python will throw an error.

Python3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
4
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
59
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
60

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
4
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
53
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
60

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
4
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
70

Output:



Traceback (most recent call last):
  File "/home/7e8862763fb66153d70824099d4f5fb7.py", line 8, in 
    print(type(true))
NameError: name 'true' is not defined

Bộ

Trong Python, Set là một tập hợp các loại dữ liệu không có thứ tự là có thể sử dụng được, có thể thay đổi và không có các yếu tố trùng lặp. Thứ tự của các phần tử trong một bộ không được xác định mặc dù nó có thể bao gồm các yếu tố khác nhau.

Tạo bộ

Các bộ có thể được tạo bằng cách sử dụng hàm

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
71 tích hợp với một đối tượng có thể lặp lại hoặc một chuỗi bằng cách đặt chuỗi bên trong niềng răng xoăn, được phân tách bằng ‘dấu phẩy. Loại phần tử trong một tập hợp không cần phải giống nhau, các giá trị loại dữ liệu hỗn hợp khác nhau cũng có thể được chuyển đến tập hợp.

Python3

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
72
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
74
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
31

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
78
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
81

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
72
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
74
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank Set: 
set()

Set with the use of String: 
{'F', 'o', 'G', 's', 'r', 'k', 'e'}

Set with the use of List: 
{'Geeks', 'For'}

Set with the use of Mixed Values
{1, 2, 4, 6, 'Geeks', 'For'}
1
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
90
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
81

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
72
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
74
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
15
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
43
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
45
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3__

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
06
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
81

Các

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
30
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
81

Output:

Initial blank Set: 
set()

Set with the use of String: 
{'F', 'o', 'G', 's', 'r', 'k', 'e'}

Set with the use of List: 
{'Geeks', 'For'}

Set with the use of Mixed Values
{1, 2, 4, 6, 'Geeks', 'For'}

Truy cập các yếu tố của các bộ

Đặt các mục không thể được truy cập bằng cách tham khảo một chỉ mục, vì các bộ không được đặt hàng nên các mục không có chỉ mục. Nhưng bạn có thể lặp qua các mục đã đặt bằng cách sử dụng vòng lặp cho vòng lặp hoặc hỏi xem giá trị được chỉ định có xuất hiện trong một tập hợp không, bằng cách sử dụng

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
34Keyword.

Python3

Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
72
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
74
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
15
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
43
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
45
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3__

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
47
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
81

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
53
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
55
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
56
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
57
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
58

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
59
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
61
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
63
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
43
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
57
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
69

Output:

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
0

Lưu ý - Để biết thêm về các bộ, tham khảo các bộ Python. To know more about sets, refer Python Sets.

Từ điển

Từ điển trong Python là một tập hợp các giá trị dữ liệu không được đặt hàng, được sử dụng để lưu trữ các giá trị dữ liệu như bản đồ, không giống như các loại dữ liệu khác chỉ chứa một giá trị đơn như một phần tử, từ điển giữ

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
70Pair. Giá trị khóa được cung cấp trong từ điển để làm cho nó được tối ưu hóa hơn. Mỗi cặp giá trị khóa trong một từ điển được phân tách bằng một đại tràng
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
71, trong khi mỗi khóa được phân tách bằng một dấu phẩy.

Tạo từ điển

Trong Python, một từ điển có thể được tạo bằng cách đặt một chuỗi các phần tử trong niềng răng xoăn

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
72, được phân tách bằng ‘dấu phẩy. Các giá trị trong từ điển có thể thuộc bất kỳ kiểu dữ liệu nào và có thể được nhân đôi, trong khi các khóa có thể được lặp lại và phải là bất biến. Từ điển cũng có thể được tạo bởi chức năng tích hợp
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
73. Một từ điển trống có thể được tạo bằng cách chỉ đặt nó vào niềng răng xoăn {}.

Lưu ý - Khóa từ điển nhạy cảm, cùng tên nhưng các trường hợp khóa khác nhau sẽ được xử lý rõ ràng.– Dictionary keys are case sensitive, same name but different cases of Key will be treated distinctly.

Python3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
76

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
79
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
87
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
89
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
68
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
7
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
89__

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
02
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
87
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
11
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
89
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
68
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
16__

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
27
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
35
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
36
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
89
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
68
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
7__

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
51
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
35
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
60
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
68
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
64
Initial blank List: 
[]

List with the use of String: 
['GeeksForGeeks']

List containing multiple values: 
Geeks
Geeks

Multi-Dimensional List: 
[['Geeks', 'For'], ['Geeks']]
7__

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
71
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Output:

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
1

Truy cập các yếu tố của từ điển

Để truy cập các mục của từ điển, hãy tham khảo tên khóa của nó. Khóa có thể được sử dụng bên trong dấu ngoặc vuông. Ngoài ra còn có một phương pháp gọi là

Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
77 cũng sẽ giúp truy cập phần tử từ từ điển.

Python3

Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
8
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
87
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
13
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
89
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
68
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
85___

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
95
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
29
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
85
String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
05

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
First element of tuple
1

Last element of tuple
5

Third last element of tuple
3
05
Initial empty Tuple: 
()

Tuple with the use of String: 
('Geeks', 'For')

Tuple using List: 
(1, 2, 4, 5, 6)

Tuple with the use of function: 
('G', 'e', 'e', 'k', 's')

Tuple with nested tuples: 
((0, 1, 2, 3), ('python', 'geek'))
3

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
0
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
1
Accessing element from the list
Geeks
Geeks
Accessing element using negative indexing
Geeks
Geeks
74
First element of tuple
1

Last element of tuple
5

Third last element of tuple
3
10
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
26
First element of tuple
1

Last element of tuple
5

Third last element of tuple
3
12

Output:

String with the use of Single Quotes: 
Welcome to the Geeks World

String with the use of Double Quotes: 
I'm a Geek


String with the use of Triple Quotes: 
I'm a Geek and I live in a world of "Geeks"


Creating a multiline String: 
Geeks 
            For 
            Life
2

4 loại dữ liệu số trong Python là gì?

Trong Python, 4 loại dữ liệu số tích hợp là:..
INT: Đây là số lượng toàn bộ phạm vi không giới hạn.....
Long: Đây là những số nguyên dài trong Python 2. ....
Float: Đây là các số điểm nổi được biểu thị là số chính xác gấp đôi 64 bit.....
phức tạp: là những con số không dấu với các thành phần thực và tưởng tượng ..

Những loại dữ liệu số nào?

Các loại chính xác là số nguyên, lớn, thập phân, số, số và tiền.Các loại số gần đúng, các giá trị trong đó độ chính xác cần được bảo tồn và tỷ lệ có thể nổi.Các loại số gần đúng là độ chính xác gấp đôi, float và thực.INTEGER , BIGINT , DECIMAL , NUMERIC , NUMBER , and MONEY . Approximate numeric types, values where the precision needs to be preserved and the scale can be floating. The approximate numeric types are DOUBLE PRECISION , FLOAT , and REAL .

5 loại dữ liệu trong Python là gì?

Kiểu dữ liệu Python..
Numbers..
String..
Tuple..
Dictionary..

Một số trong Python là gì?

Python có ba loại dữ liệu số tích hợp: số nguyên, số dấu phẩy động và số phức.Trong phần này, bạn sẽ tìm hiểu về số nguyên và số dấu phẩy động, là hai loại số được sử dụng phổ biến nhất.integers, floating-point numbers, and complex numbers. In this section, you'll learn about integers and floating-point numbers, which are the two most commonly used number types.