python-Zhou Test 2

Source: Internet
Author: User
Tags reflection

Exam Scope:1. Python Basics2. Data type3. Process Control4.? Piece processing5. function6.? To an object##############1There are three properties for defining variables, respectively. What's the equivalent of the equals sign?  is? What is the more? 2To assign a value of 10 to a variable x, y, z3. List of resources [3.1,2.1,4.3,2.2,1.3,9.3], please take out the first two?, assign a value to two variable names,??? Code implementation4. What are the mutable data types and what are the immutable data types ?5. What are the container types? What is the sequence type? 6. Please indicate what is the default encoding in Python2 and Python3? 7. How to ensure that the program does not appear garbled problem? 8.unicode,utf-8,gbk,ascii? A byte table? A byte table?#What's the-*-coding:utf-8-*-? 9. What is the encoding of STR in Python3, and how to turn str in Python3 into utf-8 format of bytes10. How to put utf-in Python38 Format bytes decoded to str11.? What is the difference between this treatment R and RB? Explanation? The following three parameters are respectively open (F_name, ' R ', encoding="Utf-8")12. What is a namespace? What is the order in which namespaces are loaded? What is the order in which the names are found? 13. The following results are? defF1 (): X=1defF2 ():deff3 ():Print(x)returnf3returnF2 () func=F1 ()defFoo (): x=1000func () foo ()14what is an iterator object and what is an iterator object? 15The iterator object has what a bit16. Briefly describe the principle of a For loop17. Brief introduction to process programming18.? More than two worth of, to get a better value,??? Code implementation19. To make a list? or Builder expressions resolve the following issues1, will names=[' Egon ','ALEX_SB','Wupeiqi','Yuanhao'] All the names in the book are changed.2, will names=[' Egon ', ' ALEX_SB ','Wupeiqi','Yuanhao'] In the name of SB, and save the remaining name length3, the length of the longest in the a.txt (length by character count, need to make? Max function4the total number of characters included in the a.txt? Think about why the sum of n times after the first order of sum results in 0? (Need to make? Sum function)5, thinking with open ('a.txt') as f:g= (Len Line) forLineinchf)Print(SUM (g))#Why the error? 6, the Shopping.txt content is as follows Mac,20000,3Lenovo,3000,10 tesla,1000000,10 chicken,200,1How much does it cost in total? Print out information for all items in the format [{'name':'XXX',' Price': 333,'Count': 3},...] Ask for the price of goods in 10000 of the product information, format ibid .20the dictionary of the name and salary of a depository clerk is as follows salaries={'Egon': 3000,'Alex': 100000000,'Wupeiqi': 10000,'Yuanhao': 2000} please??? Code implementation1, the person who pays the most? name2. Map the dictionary to a list, [(' Egon', 36000), ('Alex', 1200000000), ('Wupeiqi',120000), ('Yuanhao', 24000)], each element in the list is a member? The annual salary of the name and the clerk?3, filter out salary? 10000 of the staff? Name21stthe same point and difference between yield and return22What is the difference between an object and a process? 23. Define Oldboyteacher, Oldboystudent, Oldboypeople, Course, classes classes, and reduce code redundancy based on inheritance and composition24briefly describe the implementation principle of Python inheritance, what is the new class? What is a classic class? And the difference between a new class and a classic class in property lookup? 25. Define a people class to disguise the BMI index as a data attribute26. Define a people class, each of which has attribute names, genders, and defines the format of the printed object as [name: Age]27. Describe the polymorphism and type of duck? 28. What is reflection and how is reflection implemented? 29.? Define the Meta class control class name? letters must be written.30. Define a meta-class to control the class production? The properties of the object are all added to the beginning and become hidden properties
Questions

python-Zhou Test 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.