Python 3 kiểu dữ liệu cơ bản là gì?

Các kiểu 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 thao tác nào có thể được thực hiện trên một dữ liệu cụ thể. Vì mọi thứ đều là đối tượng trong lập trình Python, nên kiểu dữ liệu thực chất là các lớp và biến là thể hiện [đối tượng] của các lớp này

Sau đây là kiểu dữ liệu tiêu chuẩn hoặc tích hợp sẵn của Python

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

số

Trong Python, kiểu 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ố thực hoặc thậm chí là số phức. Các giá trị này được định nghĩa là lớp

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
4 và
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
5 trong Python

  • Số nguyên - Giá trị này được biểu thị bằng lớp int. Nó chứa các số nguyên dương hoặc âm [không có phân số hoặc số thập phân]. Trong Python không có giới hạn về thời lượng một giá trị số nguyên có thể
  • Float – Giá trị này được đại diện bởi lớp float. Nó là một số thực với biểu diễn dấu phẩy động. Nó được chỉ định bởi một dấu thập phân. Theo 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 biểu diễn bằng lớp phức. Nó được chỉ định là [phần thực] + [phần ảo]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 dùng để xác định kiểu của kiểu 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 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______74
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

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

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
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

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 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
72

_______73______74____175____76

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
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
78

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

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 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
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
73
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
74

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
77
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
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
70

đầu ra

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
8Loại trình tự

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

  • Sợi dây
  • Danh sách
  • Tuple

1] Chuỗi

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

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
71.
 

Tạo chuỗi

Các chuỗi trong Python có thể được tạo bằng cách sử dụng dấu ngoặc đơn hoặc dấu ngoặc kép hoặc thậm chí là dấu ngoặc kép

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
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
73

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
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
75

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

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
77
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
79

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____74____502
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____505

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
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
07

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

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
77
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
91

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____74____594
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____505

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
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
91

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
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
07

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
94

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
77
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
97

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
80
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____505

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
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
91

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
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
00

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
77
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
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

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
07

_______73____74____010

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____505

đầu ra

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

 

Truy cập các phần tử của String

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

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
14

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
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
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
77
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
19

_______73____74____022

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____505

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
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
27

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____74____030
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____033
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
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
35

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
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
37

_______73____74____040

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____033____044
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
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
35

đầu ra

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s

 

Lưu ý – Để biết thêm về chuỗi, hãy tham khảo Chuỗi Python

2] Danh sách

Danh sách cũng giống như mảng, được khai báo bằng các ngôn ngữ khác, là tập hợp dữ liệu có thứ tự. Nó rất linh hoạt vì các mục trong danh sách không cần phải cùng loại.
 

Tạo danh sách

Danh sách trong Python có thể được tạo bằng cách đặt chuỗi bên trong dấu ngoặc vuông

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
47

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
48

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
49

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
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
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
52
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
54

_______73____74____057____503

_______73____74____052____503

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
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
64

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
65

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
52
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
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
69
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 String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____74____073
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

_______73____74____052____503

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
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
80

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
81

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
52
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
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
85
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
87
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
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
70

_______73____74____093

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
52____068
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 String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
00

_______73____74____052____068

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
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
35

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
74

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
08

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
09

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
52
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 String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

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

First character of String is: 
G

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

First character of String is: 
G

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

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
18

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
21
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

_______73____74____052____503

đầu ra

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

 

Truy cập các phần tử của Danh sách

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
27 để truy cập một mục trong danh sách. Trong Python, các chỉ số thứ tự âm đại diện cho các vị trí từ cuối mảng. Thay vì phải tính offset như trong
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
28, chỉ cần viết
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
29 là đủ. Lập chỉ mục phủ định có nghĩa là bắt đầu từ cuối, -1 đề cập đến mục cuối cùng, -2 đề cập đến mục cuối cùng thứ hai, v.v.

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
48

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
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
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
80

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
81

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
52
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
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
85
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
87
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
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
70

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
74

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
45

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
46

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
49
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
52____068
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 String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
00

_______73____74____052____068

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
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
35

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
64

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
65

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
68
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
74

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
3______74____052____068
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
44
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
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
35

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
74

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
80

_______73______74____052____068

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
44
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
86
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
35

đầu ra

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

Lưu ý - Để biết thêm về Danh sách, hãy tham khảo Danh sách Python

 

3] Bộ ba

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
88.
 

Tạo Tuple

Trong Python, các bộ dữ liệu được tạo 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. Các bộ dữ liệu có thể chứa bất kỳ số lượng phần tử nào và của bất kỳ kiểu dữ liệu nào [như chuỗi, số nguyên, danh sách, v.v. ]

Ghi chú. Các bộ dữ liệu cũng có thể được tạo bằng một phần tử duy nhất, nhưng hơi phức tạp một chút. Có một phần tử trong ngoặc là không đủ, phải có dấu 'dấu phẩy' ở cuối để biến nó thành một bộ

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
48

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
90

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
74

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
92

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
93
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
95

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
98
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

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
701

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
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
703

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
704

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
93
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
13
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
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
03

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
714
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____1701

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
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
719

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
720

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
721
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
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
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
72
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
728
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
6
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
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
732
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 String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
736
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______74____788
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
741

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

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
743

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
744

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
93
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
88
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
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
03

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
753
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____1701

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

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
758

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
759

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
93
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
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 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
45
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
72
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
86
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
771
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____1774
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
776
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
778
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
780

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
783
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____1786

đầu ra

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

 

Lưu ý - Việc tạo bộ dữ liệu Python mà không sử dụng dấu ngoặc đơn được gọi là Đóng gói bộ dữ liệu

Truy cập các phần 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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
27 để truy cập một mục trong bộ dữ liệu. 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 chỉ mục lồng nhau

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
789

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

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
791
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
88
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
794
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
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
72
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
86
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
728
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
2
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
704

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

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
706

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______74____2709
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
710

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____2712____034
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
704

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

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
716

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
717

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
720
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
710

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____2712____044
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
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
704

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
3______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
730
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
710

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
86
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
704

đầu ra

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ộ dữ liệu, hãy tham khảo Python Tuples

Boolean

Loại dữ liệu có một trong hai giá trị tích hợp sẵn,

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
737hoặ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
738. Các đối tượng Boolean bằng True là đúng [đúng] và những đối tượng bằng Sai là sai [sai]. Nhưng các đối tượng không phải Boolean cũng có thể được đánh giá trong ngữ cảnh Boolean và được xác định là đúng hay sai. Nó được ký hiệu là lớp
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
739

Lưu ý - Đúng và Sai với chữ 'T' và 'F' viết hoa là các phép toán hợp lệ nếu không python sẽ báo lỗi

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
741

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
3______74
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
4
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
737
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
748

Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
4
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
738
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
748

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
3______74
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
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
759

đầu ra

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
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
9Bộ

Trong Python, Set là một tập hợp kiểu dữ liệu không có thứ tự, có thể lặp lại, có thể thay đổi và không có phần tử trùng lặp. Thứ tự các phần tử trong một tập hợp không xác định mặc dù nó có thể bao gồm nhiều phần tử khác nhau

Tạo bộ

Có thể tạo các bộ bằng cách sử dụng 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
760 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 dấu ngoặc nhọ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 nhất thiết 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




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
48

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
762

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
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
764

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
765
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
767______795

_______73____74____2771

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____2774

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
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
776

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
65

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
765
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
767____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
19
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____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
786
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____2774

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

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
791

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
792

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
765
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
767_______1794____085
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
6______087
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
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
35

_______73____74____3705

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____2774

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

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
776

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
711

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
712

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
765
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
767_______1794
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
6______272
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
13
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
728
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
15
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
732
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
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
35

_______73____74____3733

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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____2774

đầu ra

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
8

 

Truy cập các phần tử của Sets

Không thể truy cập các mục của tập hợp bằng cách tham chiếu đến một chỉ mục, vì các tập hợp không có thứ tự 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 của tập hợp bằng cách sử dụng vòng lặp for hoặc hỏi xem giá trị đã chỉ định có xuất hiện trong một tập hợp hay không bằng cách sử dụng từ khóa

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
737

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
738

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
739

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
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
741

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
765
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
767_______1794____085
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
6______087
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
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
35

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______74____3754
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

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____2774

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
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
759

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
760

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____74____3763
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
765
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
766______3737
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
768

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
769
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3____3771
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
773
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
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
776

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
777

Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
3______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
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
737
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
782

đầu ra

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ộ, hãy tham khảo Bộ Python

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ó thứ tự, đượ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ị dưới dạng phần tử, Từ điển chứa cặp

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
783. Khóa-giá trị được cung cấp trong từ điển để tối ưu hóa hơn. Mỗi cặp khóa-giá trị trong Từ điển được phân tách bằng dấu hai chấ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
784, trong khi mỗi khóa được phân tách bằng 'dấu phẩy'

Tạo từ điển

Trong Python, Từ điển có thể được tạo bằng cách đặt một chuỗi các phần tử trong dấu ngoặc nhọn

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
785, đượ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 sao chép, trong khi các khóa không thể lặp lại và phải không thay đổi. Từ điển cũng có thể được tạo bằng chức năng tích hợp
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
786. Một từ điển trống có thể được tạo bằng cách chỉ cần đặt nó vào dấu ngoặc nhọn{}

Lưu ý – Các khóa từ điển có phân biệt chữ hoa chữ thường, cùng tên nhưng khác chữ hoa chữ thường sẽ được xử lý khác biệt

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
787

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
788
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
004
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
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
784
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
13
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
915
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
784
Initial String: 
GeeksForGeeks

First character of String is: 
G

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

First character of String is: 
G

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

First character of String is: 
G

Last character of String is: 
s
86
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
784
Initial String: 
GeeksForGeeks

First character of String is: 
G

Last character of String is: 
s
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
016

3 loại kiểu dữ liệu là gì?

Có 3 loại dữ liệu .
Dữ liệu ngắn hạn. Đây thường là dữ liệu giao dịch. .
Dữ liệu dài hạn. Một trong những ví dụ tốt nhất về loại dữ liệu này là dữ liệu chứng nhận hoặc công nhận. .
dữ liệu vô dụng. Than ôi, quá nhiều cơ sở dữ liệu của chúng tôi chứa đầy dữ liệu thực sự vô dụng

5 loại dữ liệu trong Python là gì?

Kiểu dữ liệu Python .
Kiểu dữ liệu số Python. Kiểu dữ liệu số Python được sử dụng để chứa các giá trị số như;.
Kiểu dữ liệu chuỗi Python. Xâu là một dãy các ký tự. .
Kiểu dữ liệu danh sách Python. Danh sách là một kiểu dữ liệu linh hoạt độc quyền trong Python. .
Python Tuple. .
Từ điển Python

Chủ Đề