Hướng dẫn getting started with python class 11 questions - bắt đầu với câu hỏi python lớp 11

Câu hỏi loại câu trả lời rất ngắn [1 điểm mỗi]

Câu 1: Hai chế độ trong Python là gì? Trả lời: Lập trình chế độ tương tác và lập trình chế độ tập lệnh.
What are the two modes in Python ?
Answer:
Interactive Mode Programming and Script Mode Programming.

Câu 2: Viết bất kỳ hai loại dữ liệu tiêu chuẩn trong python.answer: list và chuỗi.
Write any two Standard Data Types in Python.
Answer:
List and String.

Câu 3: Liệt kê là một loại dữ liệu tiêu chuẩn? Trả lời: Có, Danh sách là loại dữ liệu tiêu chuẩn.
Is List a standard data type ?
Answer:
Yes, List is a standard data type.

Câu 4: Viết loại từ điển Python? Trả lời: Từ điển Python là loại loại bảng băm.
Write the kind of Python’s dictionary ?
Answer:
Python’s dictionaries are kind of hash table type.

Câu 5: Phần mở rộng của ngôn ngữ Python là gì? Trả lời: Tất cả các tệp Python đều có phần mở rộng .Py.
What is the extension of Python language?
Answer:
All Python files have extension “.py”.

Câu 6: Chế độ nào của Python gọi trình thông dịch mà không chuyển tệp tập lệnh dưới dạng tham số? Trả lời: Lập trình chế độ tương tác.
Which mode of Python invoking the interpreter without passing a script file as a parameter ?
Answer:
Interactive Mode Programming.

Câu 7: Chế độ Python gọi trình thông dịch với tham số tập lệnh bắt đầu thực thi tập lệnh và tiếp tục cho đến khi tập lệnh kết thúc? Trả lời: Lập trình chế độ tập lệnh.
Which mode of Python invoking the interpreter with a script parameter begins execution of the script and continues until the script is finished ?
Answer:
Script Mode Programming.

Câu 8: Trong chế độ của Python, trình thông dịch không còn hoạt động nữa? Trả lời: Lập trình chế độ tập lệnh.
In which mode of Python, the interpreter is no longer active ?
Answer:
Script Mode Programming.

Câu 9: Các biến Python có phải được khai báo rõ ràng để dự trữ không gian bộ nhớ không? Trả lời: Có.
Do Python variables have to be explicitly declared to reserve memory space ?
Answer:
Yes.

Câu 10: Python có cho phép bạn gán một giá trị duy nhất cho một số biến đồng thời không? Trả lời: Có, Python cho phép bạn gán một giá trị duy nhất cho một số biến đồng thời.
Does Python allows you to assign a single value to several variables simultaneously ?
Answer:
Yes, Python allows you to assign a single value to several variables simultaneously.

Câu 11: Đưa ra một ví dụ về kiểu dữ liệu bất biến.answer: tuple.
Give a example of immutable data type.
Answer:
Tuple.

Câu 12: Loại giá trị nào có thể được lưu trữ trong các loại dữ liệu số.answer: Giá trị số.
Which type of values can be store in Number data types.
Answer:
numeric values.

Câu 13: Python có cho phép chỉ có dấu ngoặc kép không? Trả lời: Không, Python không cho phép các cặp trích dẫn đơn hoặc đôi.
Does Python allow for only double quotes ?
Answer:
No, Python does allow for either pairs of single or double quotes.

Câu 14: Viết tên của hầu hết các loại dữ liệu hợp chất Python linh hoạt.Answer: Danh sách.
Write the name of most versatile Python’s compound data types.
Answer:
Lists.

Câu 15: Loại dữ liệu nào bao gồm một số giá trị được phân tách bằng dấu phẩy? Trả lời: Một tuple
Which data type consists of a number of values separated by commas ?
Answer:
A tuple

Câu 16: Idle là gì? Trả lời: Idle [phát âm là IDLI] là môi trường phát triển Python phổ biến nhất không hoạt động là một từ viết tắt của môi trường phát triển tích hợp
What is IDLE?
Answer:
IDLE [pronounced as Idli] is the most popular Python development environment IDLE is an acronym of Integrated Develop Environment

Câu 17: Đặt tên cho một số lệnh của python.answer: Bản quyền, trợ giúp, tín dụng.
Name some commands of Python.
Answer:
Copyright, help, credits.

Câu trả lời ngắn câu hỏi & nbsp; [2 đánh dấu mỗi cái]

Câu 1: Sự khác biệt giữa từ khóa và mã định danh là gì? Trả lời: Từ khóa là một từ đặc biệt có ý nghĩa và mục đích đặc biệt. Từ khóa được bảo lưu và rất ít. Ví dụ: nếu, nếu không, định danh ELIF, v.v. là tên do người dùng xác định cho một phần của chương trình như biến, đối tượng, chức năng, vv Các định danh không được sử dụng lại. Chúng được xác định bởi người dùng nhưng chúng có thể có chữ cái, chữ số và một biểu tượng nhấn mạnh. Họ phải bắt đầu bằng một chữ cái hoặc dấu gạch dưới. Ví dụ: Cờ vua, _ch, v.v.
What is the difference between a keyword and an identifier ?
Answer:
Keyword is a special word that has a special meaning and purpose. Keywords are reserved and are few. For example : if, else, elif etc.
Identifier is the user-defined name given to a part of a program like variable, object, functions etc. Identifiers are not reserverd. These are defined by the user but they can have letters, digits and a symbols underscore. They must begin with either a letter or underscore. For example : chess, _ch, etc.

Câu 2: Biết chữ trong Python là gì? Có bao nhiêu loại nghĩa đen được phép trong Python? Trả lời: nghĩa đen có nghĩa là hằng số, tức là các mục dữ liệu không bao giờ thay đổi giá trị trong quá trình chạy chương trình. Python cho phép năm loại nghĩa đen:
What are literals in Python ? How many types of literals are allowed in Python ?
Answer:
Literals mean constants i.e. the data items that never change value during a program run. Python allow five types of literals :

  1. Chuỗi chữ
  2. Chữ số
  3. Boolean Biết chữ
  4. Theo nghĩa đen đặc biệt [không có]
  5. Bộ sưu tập theo nghĩa đen như bộ dữ liệu, danh sách, v.v.

Câu 3: Có bao nhiêu cách có trong Python để đại diện cho một số nguyên theo nghĩa đen? Trả lời: Python cho phép ba loại chữ số nguyên:
How many ways are there in Python to represent an integer literal ?
Answer:
Python allows three types of integer literals :

  1. Decimal [cơ sở 10] nghĩa đen.
  2. Octal [cơ sở 8] nghĩa đen.
  3. Hexadecimal [cơ sở 16] Biết chữ số nguyên. Ví dụ, thập phân 12 sẽ được viết là 14 dưới dạng số nguyên octal và oxc như số nguyên thập phân hexa. [12] 10 = [14] 8 = [OXC] 16. [như thập phân hexa]
    For example, decimal 12 will be written as 14 as octal integer and as OXC as hexa decimal integer. [12]10 = [14]8 = [OXC]16. [as hexa decimal]

Câu 4: Có bao nhiêu loại chuỗi được hỗ trợ trong Python? Trả lời: Python cho phép hai loại chuỗi:
How many types of strings are supported in Python ?
Answer:
Python allows two string types :

  1. Chuỗi dòng đơn: Các chuỗi được chấm dứt trong một dòng. Ví dụ: STR = ‘Sách Oswal
    str = ‘Oswal Books’
  2. Nhiều chuỗi: Chuỗi lưu trữ nhiều dòng văn bản. Ví dụ: Str = ‘Owal
    str = ‘Owal \
    Books’
    or str = ” ” ” Oswal
    Books
    ” ” “

Câu 5: Điều gì là không có người Hồi giáo trong Python? Trả lời: Python có một nghĩa đen đặc biệt có tên là ‘Không có gì. Không có nghĩa đen nào được sử dụng để chỉ ra một cái gì đó chưa được tạo ra. Nó cũng được sử dụng để chỉ ra sự kết thúc của danh sách trong Python.
What is “None” literal in Python ?
Answer:
Python has one special literal called ‘None’. The ‘None’ literal is used to indicate something that has not yet been created. It is also used to indicate the end of lists in Python.

Câu 6: Những yếu tố nào hướng dẫn sự lựa chọn số nhận dạng trong các chương trình? Trả lời:
What factors guide the choice of identifiers in Programs ?
Answer:

  1. Một định danh phải bắt đầu bằng một chữ cái hoặc dấu gạch dưới, theo sau là bất kỳ số lượng chữ số hoặc/ và chữ cái nào.
  2. Không có ký tự đặc biệt [ngoài ghi điểm] nên được đưa vào định danh.
  3. Không nên sử dụng từ định danh hoặc số định danh tiêu chuẩn.
  4. Thư trên và chữ thường là khác nhau. Tất cả các nhân vật đều có ý nghĩa.

Câu 7: Kích thước của các hằng số sau: \ A. Càng \ \ a ,, Manoj \, s, ‘\ \ ,, Cấm Kích thước của Manoj \ \ s s - kích thước là 7 vì nó là một chuỗi có 7 ký tự được đặt trong các trích dẫn kép. Kích thước của \ \ - kích thước là 1. Nó là một hằng số ký tự và chỉ chứa một ký tự \. Kích thước xy xy \ - là 4. Nó là một chuỗi đa dòng tạo yz với \ trong chuỗi cơ bản.
What will be the size of the following constants : “\a”. “\a”, “Manoj\’s”, ‘\”, “XY\ YZ”
Answer:
‘\a’ – size is 1 as there is one character and it is a string literal enclosed in single quotes.
“\a” – size is 1 as there is one character enclosed in double quotes.
“Manoj\’s” – size is 7 because it is a string having 7 characters enclosed in double quotes.
“\” – size is 1. It is a character constant and is containing just one character \”.
“XY\ – size is 4. It is a multiline string create YZ” with \ in the basic string.

Question 8:
What is the difference between a tuple and a list ?
Answer:
A tuple is immutable i.e. cannot be changed. It can be operated on only. But a list is mutable. Changes can
be done internally to it.
tuple initialization: a = [2,4,5] list initialization: a = [2,4,5]

Question 9:
Write various python modules convert the list to generate the output “one, two, three” ? a = [‘one’, ‘two’, ‘three’]
Answer:
> > > a = [‘one’,’two’,’three’]
>>> ‘,’.join[a]
‘one,two,three’

Question 10:
What would the following code yield ? word = ‘abcdefghij’
Answer:abcdefghij
print word[:3] + word[3:]

Question 11:
Is there a tool to help find bugs or perform static analysis?
Answer:
Yes. PyChecker is a static analysis tool that finds bugs in Python source code and warns about code complexity and style. Pylint is another tool that checks if a module satisfies a coding standard, and also makes it possible to write plug-ins to add a custom feature.

Question 12:
What is a tuple ?
Answer:
A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parentheses.

Question 13:
What is a list?
Answer:
Lists are the most versatile of Python’s compound data types. A list contains items separated by commas and enclosed within square brackets [[ ]]. To some extent, lists are similar to arrays in C. One difference between them is that all the items belonging to a list can be of different data type.

Question 14:
Explain String data type.
Answer:
Strings in Python are identified as a contiguous set of characters in between quotation marks. Python allows for either pairs of single or double quotes. Subsets of strings can be taken using the slice operator [ [ ] and [ : ] ] with indexes starting at 0 in the beginning of the string and working their way from -1 at the end.

Question 15:
What is a Number data types ?
Answer:
Number data types store numeric values. They are immutable data types, which means that changing the value of a number data type results in a newly allocated object.

Question 16:
Write the names of all Standard Data Types.
Answer:
[a] Numbers
[b] String
[c] List
[d] Tuple
[e] Dictionary

Question 17:
Write a list comprehension that builds a list of the even numbers from 1 to 10 [inclusive].
Answer:
foo = [x for x in range[l, 11] if [x % 2] = = 0] print foo [2,4,6,8,10]

Question 18:
When do you use list vs. tuple vs. dictionary vs. set?
Answer:
‘List’ is like an array, individual element of list data can be accessed using indexing and can be manipulated. “Tuples” are similar to list, but there data can be changed once created through the execution of program. ‘Set’ stores unordered values and have no index. And unlike Tuples and lists, sets can have no duplicate data. “Dictionary” is similar to what their name is. It consist of pairs of keys and thier corresponding values.

Question 19:
Explain the dictionary in Python.
Answer:

  • Python’s built-in data type is dictionary, which defines one-to-one relationships between keys and values.
  • Dictionary is indexed by keys.
  • Dictionary is similar to association array or hash table of other languages.
  • Dictionary consist of pairs’-of keys and their corresponding values.

Question 20:
What is PEP 8?
Answer:
PEP 8 is a coding convention[a set of recommendations] to write your Python code in order to make it more readable and useful for those after you.

Question 21:
Explain how Python is interpreted.
Answer:
Python program runs directly from the source code. Each type Python programs executed code is required. Python converts source code written by the programmer into intermediate language which is again translated into the native language/ machine language that is executed. So Python is an interpreted language.

Long Answer type Questions [4 mark each]

Question 1:
How do we share global variables across modules in Python?
Answer:
We can create a config file & store the entire global variable to be shared across modules or script in it. By simply importing config, the entire global variable defined. It will be available for use in other modules.
For example we want a, b & c to share between modules.
config.py :
a = 0
b = 0
c = 0
modulel.py:
import config
config.a = 1
config.b = 2
config.c = 3
• print ” a, b & c are : ” , config.a, config.b, config.c

Question 2:
What are the rules for local and global variables in Python?
Answer:
In Python, variables that are only referenced inside a function are implicitly global. If a variable is assigned a new value anywhere within the function’s body, it’s assumed to be a local. If a variable is ever assigned a new value inside the function, the variable is implicitly local, and you need to explicitly declare it as ‘global’. Though a bit surprising at first, a moment’s consideration explains this. On one hand, requiring global for assigned variables provides a bar against unintended side-effects. On the other hand, if global was required for all global references, you will be using global all the time. You have to declare as global every reference to a builtin function or to a component of an imported module. This clutter would defeat the usefulness of the global declaration for identifying side-effect.

Câu 3: Có nghĩa là ’bất biến có nghĩa là gì? Loại dữ liệu nào trong Phython là bất biến.Answer: Một biến đổi giá trị biến đổi bất biến sẽ không xảy ra. Sửa đổi một biến bất biến sẽ xây dựng lại cùng một biến. Ví dụ: >>> x = 5 sẽ tạo giá trị 5 được tham chiếu bởi x x -> 5 >>> y = x Câu lệnh này sẽ làm cho y tham khảo 5 của x. x 5 y >>> x = x + y như x, loại bất biến, đã được xây dựng lại. Trong biểu thức câu lệnh của RHS sẽ dẫn đến giá trị 10 và khi điều này được gán cho LHS [x], X sẽ xây dựng lại thành 10. Một loại dữ liệu số nguyên trong Python là bất biến.
What does ‘immutable’ mean ? Which data type in Phython are immutable.
Answer:
An immutable variable change of value will not happen in place. Modifying an immutable variable will rebuild the same variable. For example,
>>> x= 5
will create a value 5 referenced by
x x —> 5
>>> y = x
This statement will make y refer to 5 of x.
x
5
y
>>> x = x + y
As x being, immutable type, has been rebuild. In the statement expression of RHS will result into value 10 and when this is assigned to LHS [x], x will rebuild to 10. An Integer data type in python is immutable.

Câu 4: Việc chuyển đổi kiểu dữ liệu hỗ trợ Python? Trả lời: Có, chuyển đổi kiểu dữ liệu hỗ trợ Python. Để chuyển đổi giữa các loại tích hợp, lập trình viên chỉ cần sử dụng tên loại làm hàm. Có một số chức năng tích hợp để thực hiện chuyển đổi từ loại dữ liệu này sang loại dữ liệu khác. Các chức năng này trả về một đối tượng mới chế ngự giá trị được chuyển đổi.
Does Python support data type conversion ?
Answer:
Yes, Python support data type conversion. To convert between built-in types, programmer simply use the type name as a function. There are several built-in functions to perform conversion from one data type to another. These functions return a new object represting the converted value.

Hàm số Sự mô tả
int [x [, cơ sở]]Chuyển đổi X thành một số nguyên, cơ sở chỉ định cơ sở nếu X là một chuỗi.
dài [x [, cơ sở]]Chuyển đổi X thành một số nguyên dài, cơ sở chỉ định cơ sở nếu X là một chuỗi.
Float [x]Chuyển đổi X thành số FloatingPoint.

phức tạp [thực, [ing]]

Tạo ra một số phức.
str [x]Chuyển đổi đối tượng X thành biểu diễn chuỗi.
repr [x]Chuyển đổi đối tượng X thành chuỗi biểu thức.
Tuple [x]Chuyển đổi X thành một tuple.
Danh sách [x]Chuyển đổi X thành một danh sách.
chr [x]Convet một số nguyên cho một nhân vật.
unichr [x]Chuyển đổi một số nguyên thành một ký tự unicode.
Chế độ ăn uống [x]Tạo ra một sự không xác định, x phải là một chuỗi các bộ dữ liệu.
Đặt [x]Chuyển đổi X thành một tập hợp

Câu hỏi 5: Làm thế nào để bạn tạo một mảng trong Python? Trả lời: Sử dụng danh sách: [Hồi này, 1, là một người khác, một, một mảng Sự khác biệt chính là danh sách Python có thể chứa các đối tượng thuộc nhiều loại khác nhau. Mô -đun mảng cũng cung cấp các phương thức để tạo các mảng các loại cố định với các biểu diễn nhỏ gọn, nhưng chúng chậm hơn so với danh sách. Cũng lưu ý rằng các phần mở rộng số và các phần khác cũng xác định các cấu trúc giống như mảng với các đặc điểm khác nhau.
How do you make an array in Python?
Answer:
Use a list: [“this”, 1, “is”, “an”, “array”] Lists are equivalent to C or Pascal arrays in their time complexity. The primary difference is that a Python list can contain objects of many different types. The array module also provides methods for creating arrays of fixed types with compact representations, but they are slower to index than lists. Also note that the numeric extensions and others define array-like structures with various characteristics as well.

Câu 6: Làm thế nào để bạn thực hiện chuyển đổi giữa các bộ dữ liệu và danh sách? Trả lời: Hàm tple [SEQ] chuyển đổi bất kỳ chuỗi nào [thực tế, bất kỳ. Ví dụ: mang lại [[1, 2, 3]] [1, 2, 3] và mang lại [abc,] [‘a,’ b, ’c,]. Nếu đối số nếu một tuple, nó không tạo một bản sao mà trả về cùng một đối tượng, vì vậy nó sẽ rẻ để gọi Tuple [] khi bạn không chắc chắn rằng một đối tượng đã là một tuple. Danh sách chức năng [SEQ] chuyển đổi bất kỳ trình tự hoặc có thể lặp lại thành một danh sách có cùng các mục theo cùng một thứ tự. Ví dụ: List [[1, 2, 3]] mang lại [1, 2, 3] và List [‘ABC,] sản lượng [‘ A, ’B,‘ CiênJ. Nếu đối số là một danh sách, nếu tạo một bản sao giống như se [: j sẽ.
How do you make conversion between tuples and lists ?
Answer:
The function tuple [seq] converts any sequence [actually, any.iterable] into a tuple with the same items in the same order.
For example, tuple[[1, 2, 3]] yields [1, 2, 3] and tuple [‘abc’] yields [‘a’, ‘b’, ‘c’]. If the argument if a tuple, it does not make a copy but returns the same object, so it is cheap to call tuple[ ] when you aren’t sure that an object is already a tuple.
The function list[seq] converts any sequence or iterable into a list with the same items in the same order. For example, list[[1, 2, 3]] yields [1, 2, 3] and list [‘abc’] yields [‘a’, ‘b’, ‘c’j. If the argument is a list, if makes a copy just like se[:j would.

Câu 7: Sự khác biệt giữa danh sách và tuple là gì? Đưa ra một ví dụ.answer: Danh sách là container mục đích chung của Python, thường được sử dụng cho các bộ sưu tập các đối tượng tương tự. Danh sách là các đối tượng có thể thay đổi có thể chứa bất kỳ dữ liệu Python nào. Ví dụ:> Danh sách của tôi = [] # Tạo một danh sách trống> Danh sách của tôi = [1,1.0+3J, Hồi Aperitivo, đúng] # Tạo một danh sách chứa bốn thực thể. Một tuple là một giá trị bất biến [có thể thay đổi] có thể chứa bất kỳ dữ liệu python nào. Chúng thường được sử dụng cho bộ sưu tập nhỏ của dữ liệu.example:> mytuple = [1, 2, 3, 4] # Tạo một tuple bốn phần tử. > mytuple [2] = 4 # error - tuple có thể được sửa đổi. > In mytuple [2], len [mytuple]
What is the difference between list and tuple ? Give an example.
Answer:
Lists are Python’s general purpose container, often used for collections of similar objects. Lists are mutable objects that can contain any Python data. Example :
>my list = [ ] # make an Empty list
>my list = [1,1.0+3j, “aperitivo”, true] # make a list containing four entities.
A Tuple is an immutable value [can’t be changed] that can contain any Python data. They are generally used for small collectioin of data.
Example :
>mytuple = [1, 2, 3, 4] # create a four element tuple.
>mytuple[2] = 4 # Error – tuple can’t be modified. > print mytuple[2], len[mytuple]

Câu 8: Những gì được sử dụng để thể hiện các chuỗi trong Python? Trả lời: Sử dụng các trích dẫn đơn [‘] Bạn có thể chỉ định các chuỗi bằng cách sử dụng các trích dẫn đơn lẻ như‘ Trích dẫn tôi trên này. Tất cả không gian trắng, tức là các không gian và tab được bảo tồn như nó là. Sử dụng các trích dẫn kép [] trong các trích dẫn kép hoạt động chính xác giống như các chuỗi trong các trích dẫn đơn. Một ví dụ là những gì mà tên của bạn? Bạn có thể sử dụng các trích dẫn đơn và trích dẫn gấp đôi trong ba trích dẫn. Một ví dụ là, Đây là một chuỗi nhiều dòng. Đây là dòng đầu tiên. Đây là dòng thứ hai. Tôi đã hỏi những gì của bạn ?, Tôi đã hỏi. Anh ấy nói rằng Syed Saif Naqvi.
What is used to represent Strings in Python ?
Answer:
Using Single Quotes [‘]
You can specify strings using single quotes such as ‘Quote me on this’. All white space i.e. spaces and tabs are preserved as it is.
Using Double Quotes [”]
Strings in double quotes work exactly the same way as strings in single quotes. An example is “What’s your name?”
Using Triple Quotes o[”’ or ” ” “]
You can specify multi-line strings using triple
quotes. You can use single quotes and double
quotes freely within the triple quotes. An example
is
“‘This is a multi-line string. This is the first line. This is the second line.
“What’s your name?,” I asked.
He said “syed saif naqvi.”

Câu 9: Có một công cụ trợ giúp để tìm lỗi hoặc thực hiện phân tích tĩnh không? Trả lời: Có, PyChecker là một công cụ phân tích tĩnh tìm thấy lỗi trong trường hợp nguồn Python và cảnh báo về độ phức tạp và phong cách mã. Pylint là một công cụ khác kiểm tra xem một mô-đun có thỏa mãn tiêu chuẩn mã hóa hay không, và cũng có thể viết các trình cắm để thêm một tính năng tùy chỉnh.
Is there a tool help to find bugs or perform static analysis ?
Answer:
Yes, pychecker is a static analysis tool that finds bugs in Python source case and warns about code complexity and style.
Pylint is another tool that checks if a module satisfies a coding standard, and also make it possible to write plug-ins to add a custom feature.

Câu 10: Tên biến nào sau đây không hợp lệ? Biện minh. . T bắt đầu với một chữ số. [C] [Email & NBSP; được bảo vệ]: Các ký tự đặc biệt không được phép trong các tên biến.
Which of the following variable names are invalid ? Justify.
[a] try
[b] 123 Hello
[c] sum
[d] [email protected]
Answer:
[a] try : is a keyword can’t be used as an identifier.
[b] 123 Hello : Variable names can’t start with a digit.
[c] [email protected] : Special characters aren’t allowed in variable names.

Câu 11: Kể tên bốn loại dữ liệu cơ bản của Python.Tại sao chúng được gọi là như vậy? Trả lời: Bốn loại dữ liệu cơ bản là:
Name four Python’s basic data types. Why are they called so ?
Answer:
The four basic data types are :

  1. Con số
  2. Trình tự
  3. Bộ
  4. Maps.

Chúng được gọi là như vậy bởi vì:

  1. Kiểu dữ liệu số lưu trữ các giá trị số và không thể thay đổi giá trị bất biến, giá trị của đối tượng của nó.Đây là 3 loại:
    These are of 3 types :
    1. Số nguyên và dài
    2. Float/Floatingpoint
    3. Tổ hợp
  2. Trình tự là một bộ sưu tập các mục được đặt hàng, được lập chỉ mục bởi các số nguyên dương, nó là sự kết hợp của các loại dữ liệu có thể thay đổi và không thể sửa chữa.Ba loại loại dữ liệu chuỗi có sẵn trong Phyton là chuỗi, danh sách và bộ dữ liệu.
  3. Đặt trong một bộ sưu tập các giá trị không được đặt hàng của bất kỳ loại nào, không có mục nhập trùng lặp.Bộ là bất biến.Ví dụ s = set [[1,2,3,4]]
  4. Các loại dữ liệu ánh xạ không được đặt hàng và có thể thay đổi.Dictonaries nằm dưới ánh xạ.example d = {1: ‘A, 2:
    Example
    d = {1 : ‘a’, 2 : Tb’, 3 : ‘c’

Câu 12: Phân loại các loại dữ liệu Python.Answer:
Classify the Python data types.
Answer:

NCERT SolutionSComputer Khoa học Englishhindihumanitiescommercience

Bài Viết Liên Quan

Chủ Đề