Python Daily Exam Questions:

Source: Internet
Author: User
Tags shallow copy

Tag: TE pattern string flag requires the font Tor direct nbsp

6.25:

1Create an adorner capitalize the first letter of the string entered by the following function, with the remaining letters lowercase. 2Please write a Python code to replace the [Beijing, Technology, Limited, company] characters in the target string, target string: Beijing Macquarie Technology Digital Co., Ltd., required to replace the output of the Macquarie number. 3.*args,**What is the role of Kwargs?                                                                                 How to use? 4The string "HELLO PYTHON" is converted from uppercase to lowercase letters and wrapped, and then output to the Hello.txt file in Computer C. 5How do I copy an object in Python? (Assignment, shallow copy, deep copy difference) face by:1the resume must give a person's feeling is clear and generous, not too loud2to send a resume to more channels, do not just cast a platform, you can vote like wisdom, boss, pull Hook, after the investment to always pay attention to the dynamic, do not see how high their company requirements, anyway, you cast the past, and some company requirements are everywhere to copy the requirements of others company. 3After the interview must be done experience summary, will not be a problem to find the answer, do not in the same place again. 4the mentality of the interview must be better, not too nervous, encounter no problem, you can also ask the interviewer, of course, some interviewers will refuse to answer your questions, but it does not matter, you will give people a studious impression. 5The reason for leaving the job must be well thought out, give this reason must be able to persuade the interviewer6. Before the interview, you should do your own knowledge network map, know it in the heart, then you can be in position

6.26:

Re module to match (Pattern,string[,flags]) to check if the beginning of the string matches the pattern
Re module, Research (Pattern,string[,flags]), the first matching value of the pattern in a string search
2. Generate a 6-bit random verification code:
def Random_code (n=7): "for in range (n) := str (Random.randrange (0,9)) = Chr (Random.ranrange (65,99)) +=random.choice ([STR1,STR2])

3.python recovery mechanism
https://www.jianshu.com/p/1e375fb40506

4. Add missing code

def print_directory_contents (spath):
"""
This function takes the name of the folder as an input parameter,
Returns the path to the file in this folder,
and the path to the file in the containing folder.

"""

Import OS

For Schild in Os.listdir (spath):

Schildpath = Os.path.join (spath,schild)

If Os.path.isdir (Schildpath):

Print_directory_contents (Schildpath)

Else

Print Schildpath

5. Two value Exchange values
A = 10
b = 20
1.
A, B = b,a

2.
x = A
A = b
b = x

3.
A = A+b
b = A A
A = a-b

6.27:

Python Daily Exam Questions:

Related Article

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.