python-Printing Simple company employee Information sheetrequirements, input name is not empty, enter the number of times up to 3 times, 3 times after jumping out of the program;Knowledge Points:Raw_inputSTR to intWhilIf elif else continue
# -*- coding: utf-8 -*-#知识点: Reflection # Imports a module in the form of a string, which is the reflection # and executes the function as a string # see simple small particles temp = ' MySQL ' #这个字符串是模块的名字 (i.e. mysql.py or sqlserver.py, suffix
#!usr/bin/env python#-*-coding:utf-8-*-#字符串通常用双引号或单引号来表示: ' 123 ', ' abc ', ' String '#str字符串的常用方法有以下: String can be used to assign a temporary variable s#友情提示以下全是python2. x version demo, python3.x please print (put in test printing), for example:
Before writing the Keylogger finally has been in the tangled bullet frame and not the box problem, the code can not find, and today again#!/usr/bin/env python#-*-coding:utf-8-*-From ctypes Import *Import pythoncomImport PyhookImport
Topic from Project Euler 14th: https://projecteuler.net/problem=14"Project Euler:problem 14:longest Collatz sequencethe following iterative sequence are defined for the set of positive INTEGERS:N→N/2 (n is even) n→3n + 1 (n was odd) Using the rule
Lambda is just an expression, and the function body is much simpler than def.The body of a lambda is an expression, not a block of code. Only a finite amount of logic can be encapsulated in a lambda expression.A lambda expression acts as a function
Before introducing classes, I First has a to-tell you something about Python's scope rules. Class definitions play some neat tricks with namespaces, and what need to know how scopes and namespaces work to fully unde Rstand ' s going on. Incidentally,
Indent in
The most distinctive feature of Python is the code that is labeled as a block in indentation. I will use the if selection structure below for an example. If followed by the condition, if the condition is true, then a block of code that
From today onwards, I will update a Python function every day, with the example and the point of attention when using the function. I gave this function a special name called "Python function daily", I hope you support. Oh
Now, the function of
In the use of Google or Baidu search will find a picture color options, it feels very interesting, some people may think this is definitely artificial to divide, hehe, there is this possibility, but estimated that people will be exhausted, open a
Python supports four different numeric types, including int (integer) long (Long integer) float (floating point actuals) complex (complex number),
Numeric data types store values. They are immutable data types, which means changing the value of the
The recent object reference mechanism for Python has been slightly researched, leaving notes for review.
The first one is clear: all objects in "python.
So, what does this mean?
The following code:
#!/usr/bin/env Pythona = [0, 1, 2] # It's a simple
One, package name, module name, local variable name, function name
All-lowercase + underline hump
Example:this_is_var
Second, global variables
All caps + Underline hump
Example:global_var
Third, class name
First-Letter Capital
There are many ways to list types, and here are all the methods of the list type:
List.append (x)
Adds an element to the end of the list, equivalent to A[len (a):] = [x].
List.extend (L)
Adds all the elements from a given list to another list,
String decoding:
There is a string:
' \\u4fee\\u6539\\u8282\\u70b9\\u72b6\\u6001\\u6210\\u529f '
To convert to:
U "\u4fee\u6539\u8282\u70b9\u72b6\u6001\u6210\u529f"
You can do this by
>>> a = ' \\u4fee\\u6539\\u8282\\u70b9\\u72b6\\u6001\\u6210
Python built-in functions (24) -- frozenset, pythonfrozenset
English document:
Class
frozenset([
Iterable])
Return a new
frozensetObject, optionally with elements taken from
Iterable.
frozensetIs a built-in class. See
Python built-in functions (17) -- divmod, pythondivmod
English document:
divmod(A,B)
Take two (non complex) numbers as arguments and return a pair of numbers consisting of their quotient and remainder when using integer division. with mixed operand
Python built-in function complex, pythoncomplex
English document:
Class complex ([real [, imag])
Return a complex number with the value real + imag * 1j or convert a string or number to a complex number. if the first parameter is a string, it will
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