preface

After the last two lessons, you have already mastered the basics of Python strings and the basics of strings. (Ps: If you haven’t already studied python strings, please go here and watch this lesson.) 5 minutes a day to learn the basics of Python strings (5)(key), 5 minutes a day to learn the basics of Python strings (6).

Title 1

Declare multiple variables using string types and assign values to different variables in different ways. Familiar with string assignment rules and representation.

Topic 2

Now there is a string according to the following format: “| | name name: results: results… ..” Indicated that the string into the following form: “zhang SAN: 90 | li si: 80 | Cathy: 100” display the data as shown below, according to different researchers show that name: zhang SAN, the result is: 90; Name: Li Si, grade: 90; Name: Wang Wu, grade: 100;

Topic 3

Variable A is “I’m A programmer” and variable B is “I love coding”. Please splice these two sentences together and store them in A new variable C, and line feed output is required.

Topic 4

I have an important file in “G:\publish\codes\02\2.4”. What should I say about the variable that defines the path?

Topic 5

Given a string, determines whether the string contains a substring. If contained, find all occurrence positions of the substring. For example, in “iamvirus”, the occurrence position of “AM” substring is: 1

Topic 6

Uppercase the string “virus”, uppercase it all, and lowercase it again.

Topic 7

String = “Virus is good”, replace Virus in string with Python and print the result

The title 8

“This is a book\n”, there is a carriage return at the end of the string, please delete it

Topic 9

Variable A is “90” and variable B is 80. Sum them up

The title 10

String = “Python is good”, please intercept “on is good”

Supervise and urge to learn

Don’t know if you have such a situation, background many classmates contact me said recently, always ready to learn, but once in front of the computer, is still not to heart, and who was particularly upset, and then work more and more busy, for a long time, is to learn to forget, for the students of this kind of situation, I decided I spare a little time out every day, Remind you to study, and supervise and tutor your learning situation, if you need, please scan the following TWO-DIMENSIONAL code, click to contact the author to understand.

conclusion

Although there are a lot of questions, they cover the knowledge learned in the previous two chapters, and if you have studied hard in front of you, you should also be easy to do, well, you have to cheer up oh! Next time we’ll talk about lists.