I used to do the project in accordance with the gourd drawing dipper set {font-family:arial, "Microsoft Yahei", simsun,sans-self;} and other similar fonts, however, when more devices and systems appear, Previous settings such as this have not been able to meet the needs of Web pages on each device.For the simplest SimSun, the display in Windows is a relatively easy-to-read font, but on a Mac you can't look directly at it, such as a comparison of the pages before and after the optimization:Source
I used to do the project in accordance with the gourd drawing dipper set {font-family:arial, "Microsoft Yahei", simsun,sans-self;} and other similar fonts, however, when more devices and systems appear, Previous settings such as this have not been able to meet the needs of Web pages on each device.For the simplest SimSun, the display in Windows is a relatively easy-to-read font, but on a Mac you can't look directly at it, such as a comparison of the pages before and after the optimization:So, fo
I used to do the project in accordance with the gourd drawing dipper set {font-family:arial, "Microsoft Yahei", simsun,sans-self;} and other similar fonts, however, when more devices and systems appear, Previous settings such as this have not been able to meet the needs of Web pages on each device.For the simplest SimSun, the display in Windows is a relatively easy-to-read font, but on a Mac you can't look directly at it, such as a comparison of the pages before and after the optimization:Source
Introduction: Sogou Input method is the most useful and popular on the market input method, the most conscientious is also the Linux version, which let me and other Linux people cheered. In the new Ubuntu 16.04 on the installation of Sogou input method, encountered some problems, mainly or rely on the package is not properly installed, we look at how to solve this problem.
1. Introduction to the Environment
Ubuntu 16.04, Sogou Input Method: Sogoupinyin_2.0.0.0078_amd64
2. Problem performance[HTM
Picnic cowsTime limit:8000/4000 MS (java/others) Memory limit:32768/32768 K (java/others)Total submission (s): 2192 Accepted Submission (s): 675Problem Description It ' s summer vocation now. After tedious milking, cows is tired and wish to take a holiday. So Farmer Carolina considers has a picnic beside the river. But there was a problem, not all the cows consider it ' s a good idea! Some cows like to swim in West Lake, Some prefer to has a dinner in Shangri-La, and others want to do something
3409: [Usaco2009 Oct]barn Echoes bullpen echo time
limit:3 Sec Memory limit:128 MBsubmit:57 solved:47[Submit] [Status] [Discuss]
DescriptionThe cows often enjoy the moo in the barn because they can hear the echoes of their moo. Although sometimes it is not possible to fully hear the full echo. Bessie used to be an excellent secretary, so she accurately recorded all the screams and their echoes. She
string is immutable sequence‘http://www.python.org‘>>>website[-3‘com‘#错误string Formatting –%% Place a string on the left, and the value you want to format on the right:>>>format‘Hello %s %s enough for ya?‘>>>values = (‘world‘‘hot‘)>>>printformatvaluesfor ya?If the string contains a percent semicolon, then you need to use a percent percent to denote a semicolon.The s in%s represent a string, and if you format a floating-point number and want to retain three decimal places, you can use the%.3fThe
3.1 basic string operations
All standard sequence operations (index, sharding, multiplication, determining membership...) are also applicable to strings. However, please remember the wordsCharacter strings cannot be changed.
3.2 string formatting: Lite version
The first time I came into contact with python programming, I used a little bit of string formatting content. Here I just give an example to get a rough idea:
>>> format = " Hello,%s,%s enough for ya ?">>> values = ('world','hot')>>
conversion value. 0 indicates that if the number of digits of the conversion value is not enough, fill it with 0.(3) * The minimum field width can be specified.(4) Point (.) follows the precision value.
String method:
(1) find: You can search for a substring in a long string and return the leftmost index of the substring. If not found,-1 is returned.
Print 'With a moo-moo here, and a
String manipulation:
The% format operation of the string:"Hello,%s.%s enough for ya ?"values = (‘world‘,‘hot‘)print str % values输出结果: Hello,world.hot enough for ya ?
Template string: #coding =utf-8from String import template## single variable replace S1 = Template ( ' $x, glorious $x! ') Print S1.substitute (x = ' Slurm ') # # dollar sign representation and substitution of a single variable s2 = Template ( ' Slurm ') # # field variable substitution s3 = Template ( ' A $thing Must
String methodString.digits: String containing the number 0-9String.letters: A string containing all letters (uppercase or lowercase)String.lowercase: A string containing all lowercase lettersString.printable: A string containing all printable charactersString.punctuation: A string containing all punctuationString.uppercase: A string containing all uppercase lettersThe Find method can look up substrings in a longer string. Returns the leftmost index where the substring is located. Returns 1 if no
built-in ord function, while the chr function performs the opposite operation:
Copy codeThe Code is as follows:>>> Ord ('s ')115>>> Chr (1, 115)'S'
String Method
Strings are much richer than list methods, because strings are inherited from the string module. This article only introduces some particularly useful string methods.
1. find
The find method can be used to search for a substring in a long string. It returns the leftmost index of the substring location. If no substring is found,-1 is re
)% character: The beginning of the token conversion specifier is the beginning of the substitution.(2)-Indicates left alignment, + indicates that the value is preceded by a positive sign. 0 indicates that the number of converted values is not enough to be populated with 0.(3) * You can specify the minimum field width.(4) point (.) followed by the precision value.
String method:
(1) Find: You can find substrings in a longer string and return to the leftmost index where the substring is located. R
Basic string manipulationAll standard sequence Operations (index, Shard, multiply, Judge membership, seek length, take maximum and minimum), also apply to strings. However, the string is immutable.String methodThere are too many ways to string, but here are just a few things that are particularly useful.FindThe Find method can look up a substring in a longer string, which returns the leftmost index at the position where the substring is located. If not found, returns-1>>> ' with a
'
>>># Similarly, you can convert a floating point to a string or a string to a floating point.
>>> Str (3.1415), float ("1.3 ")
('3. 100', 1415)
>>> Text = '1. 23E-10'
>>> Float (text)
1.23e-10
String code conversion
A single character can also be converted to its corresponding ASCII code by passing it to the built-in ord function, while the chr function performs the opposite operation:
The code is as follows:
>>> Ord ('s ')115>>> Chr (1, 115
Basic string operations
All standard sequence operations (indexing, partitioning, multiplication, determining membership, length, minimum and maximum values) are also applicable to strings, as described earlier. However, note that the strings are immutable.
String method:
String fromStringThere are many methods for "inheritance" in the module. Here we only introduce some particularly useful methods.
1,Find
FindYou can search for a substring in a long string. It returns the leftmo
anything else.Reference code:Copy codeThe Code is as follows:// String to be testedVar string_to_test = "lets match everything ";// Test whether the string is exactly the same as "lets match everything" and returns true.Var is_true = string_to_test.match ("^ lets match everything $ ");// Test whether the string is exactly the same as "lets everything" and returns false.Var is_false = string_to_test.match ("^ lets everything $ "); String to be tested:Regular ExpressionCase InsensitiveCharacter S
$");
By using these two operators together, you can do a very clean test: You can check that a string is not just the content of the expression you want to match without anything else.
Reference code:
Copy Code code as follows:
The string we want to test
var string_to_test = "Lets match everything";
Test this string is not exactly the same as "lets match everything", returns true
var is_true = String_to_test.match ("^lets match everything$");
Test this string is n
substrings in a longer string. It returns the leftmost index of the location where the substring is located. Returns 1 if not found>>> ' with a Moo-moo here,and a moo-moo there '. Find (' moo ')7>>> title = "Monty Python ' s Flying Circus">>> title.find (' Monty ')0>>> titl
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.