1. SummaryPopular Understanding __name__ == ‘__main__‘ : If you call Xiaoming, in the eyes of friends, you are Xiao Ming (__name__ == ‘小明‘) ; in your own eyes, you are yourself (__name__ == ‘__main__‘) .if __name__ == ‘__main__‘The code block below
Practice Python Multi-level menu reading function, is actually the list or the dictionary of ITER
Functional Requirements:
Run the program output first level menu
Select a Level menu item, output Level Two menu, the same output
One, what is the function name?Function names are the names of functions, Nature: variables, special variables.Function name () Execute this functionWhen the function is executed (called): Break. * An Iterative object (Str,tuple,list,dict (key))
1. What's the language of Python? Python is a dynamic, explanatory, strongly typed, defined language.(1) Dynamic language and static language① static language: The language in which data type checking is done during compilation, such as C,c++.②
The Python OS module provides a unified operating system interface function One, for the operation of the system 1, Os.name is currently using the platform where ' NT ' is windows, ' POSIX ' is a specific path delimiter for Linux or unix2, OS.SEP
error Description: Using tensorflow backend.I. Installing Microsoft Visual C + + redistributable Update 3First in https://www.microsoft.com/en-us/download/details.aspx?id=53587.Download Microsoft Visual C + + redistributable Update 3.and then
Why should I have an adorner?Open closure principle: Closed to modification, open to expansionWhat is an adorner?Adorners are callable functions, which are also functions that can be called by decorators.Principle: Do not modify the code of the
Recursive functions:Inside a function, you can call other functions. If a function calls itself internally, the function is a recursive function.Cases:def Calc (n): Print (n) if int (N/2) = =0 :return n return calc (int (n/2))
One, string slices# slices can also fit into the string tittle=' today's hair apple ' for in Enumerate (tittle): # enumerate can loop subscript and value at the same time Print ('%s:%s' % (i,t))Second, non-empty is true# non-empty is true Print
1. Containers, iterative objects, iterators, generator concepts1. Container: A data structure that stores many elements. Usually stored in memory (iterators, generators are special cases) can use in to determine whether an element exists in the
no best, only more reasonable!Use the default list printing format to store and report the fact that it is not a very well, thinking about modifying the changes, so:# -*- coding: utf-8 -*-import osdef cdwalker (Cdrom, cdcfile): export = ""
Pseudo-Private propertiesThe variable __x defined in class Example automatically becomes _example__x, and the variable with double underscore before the variable is called a pseudo-private property, why is it called a pseudo-private attribute?
This article mainly for you in detail the Python Basic Tutorial project Five virtual Tea Party, with a certain reference value, interested in small partners can refer to
Almost every time you learn or use any programming language, there is never a
This article is mainly to share with you the Python list of functions & methods in detail, I hope to help everyone.
Python list Functions & methods
Python contains the following functions:
Serial Number
function
1
CMP
Python basics 7: python BasicsI. Data Type Supplement 1. str
#1. casefold # usage: S. casefold () # meaning: the lower () method is only ASCII encoded, that is, 'a-Z', effective for other languages (non-Chinese or English) can only use the casefold (
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