PROGRAMMING IN PYTHON 3 - PART 2

Tham khảo tài liệu 'programming in python 3 - part 2', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | This page intentionally left blank 2 Identifiers and Keywords Integral Types Floating-Point Types Strings Data Types In this chapter we begin to take a much more detailed look at the Python language. We start with a discussion of the rules governing the names we give to object references and provide a list of Python s keywords. Then we look at all of Python s most important data types excluding collection data types which are covered in Chapter 3. The data types considered are all built-in except for one which comes from the standard library. The only difference between built-in data types and library data types is that in the latter case we must first import the relevant module and we must qualify the data type s name with the name of the module it comes from Chapter 5 covers importing in depth. Identifiers and Keywords Object refer- ences 16 When we create a data item we can either assign it to a variable or insert it into a collection. As we noted in the preceding chapter when we assign in Python what really happens is that we bind an object reference to refer to the object in memory that holds the data. The names we give to our object references are called identifiers or just plain names. A valid Python identifier is a nonempty sequence of characters of any length that consists of a start character and zero or more continuation characters . Such an identifier must obey a couple of rules and ought to follow certain conventions. The first rule concerns the start and continuation characters. The start character can be anything that Unicode considers to be a letter including the ASCII letters a b . z A B . Z the underscore _ as well as the letters from most non-English languages. Each continuation character can be any character that is permitted as a start character or pretty well any nonwhitespace character including any character that Unicode considers to be a digit such as 0 1 . 9 or the Catalan character . Identifiers are case- 51 52 Chapter 2. Data Types .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
63    510    2    09-05-2024
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.