Câu hỏi phỏng vấn Python
Câu hỏi

What are the built-in types available In Python?

Câu trả lời

In Python, there are several built-in data types that are categorized into different classes. These data types are integral to the language and are used to define the type of a variable, which in turn determines what kind of operations can be performed on it. Here are the built-in data types available in Python:

  • Text Type:

    • str (String): Used to represent text data. It is a sequence of Unicode characters enclosed in single, double, or triple quotes.
  • Numeric Types:

    • int (Integer): Represents whole numbers, both positive and negative, without a fractional component.
    • float (Floating-point number): Represents real numbers and includes a decimal point. It can also represent numbers in scientific notation with an "e" to indicate the power of 10.
    • complex (Complex number): Represents a number with a real and an imaginary part, denoted as (real part) + (imaginary part)j.
  • Sequence Types:

    • list: An ordered and mutable collection of items that can be of different data types.
    • tuple: An ordered and immutable collection of items that can be of different data types.
    • range: Represents a sequence of numbers, typically used in for loops for iteration.
  • Mapping Type:

    • dict (Dictionary)...
entry

entry

Gợi ý câu hỏi phỏng vấn

senior

What is GIL?

middle

Explain how to use Slicing in Python?

senior

Why are default values shared between objects?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào