Day 10 learning exercises completed in python

Basics Exercises: 

1, python script execution in two ways:

2, the relationship between short-answer bit, byte

3, ascII, unicode, utf-8, gbk relationship

4, please write "Jie" bits respectively utf-8 encoded and gbk

5, python single-line and multi-line comments are what?

6, declare variables precautions What?

7, if a variable n = 5, using the methods provided int obtain the minimum number of variable binary bits can represent?

8, Boolean values ​​What?

9, read the code, please write the results

a="alex"

b = a.captalize ()

print(a)

print(b)

Please write the output:

10, write code, the following variables, please realize each function in accordance with the requirements

name="aleX"

The contents a, removed name spaces on both sides of the corresponding variable value and outputs removed

B, is determined name variable corresponds to whether the value of "al" at the beginning, and outputs the result

C, determined name variable corresponding to whether the value of an "X" at the end, and outputs the result

d, the corresponding value of the variable name 'a' is replaced with "p", and outputs the result

E, the name corresponding variable value in accordance with "|", and outputs the result

f, ask a question on e get value after the split is what type?

g, a value corresponding to the uppercase name variable, and outputs the result

H, corresponding to the value of the variable name lowercase, and outputs the result

i, please name the output variable corresponding to the second character values?

j, please name the output variable corresponding to the value of the first three characters?

k, please name the output variable corresponding to the value of the two characters?

l, please index is located in the output "e" variable name corresponding to a position value?

m, obtaining sub-series, not only contains the last character. Such as: oldboy then get oldbo, root is acquired roo

11, on behalf of the target string is optional? As you can use a for loop each element?

12, please use the code to achieve:

a, using underlined each element of the list spliced ​​into a string, li = "alxericranin"

b, using underlined each element of the list spliced into a string, li = [ "alx", "eric", "ranin"]

13, the difference rangge python2 in the range of python3 in?

14, to achieve a calculator integer addition:

Such as: content = input ( "Please enter Content"), such as #: 9 or 5 + 5 + 5 + 9 or 9

15, calculate the content entered by the user in a few decimal? Several letters?

Such as: Content = the INPUT ( "Please enter content") # such as: dhakhdahs62312gsdgag98

16, and 9 int brief relationship as well as other digital str and "xx00" and other strings?

17, making fun module program

Requirements: waiting for the user to enter the name, location, hobbies, arbitrarily implemented according to the user's name and preferences

Such as: *** Dear amiable, like most places in the dry *** ***

18, an optional random codes ----

19, sensitive words filtered development program prompts the user to enter content, content if a customer entered contains special characters

Such as: "Aoi," "Tokyo hot", then replace the contents as follows: Old Boys

20, create a table

Loop prompts the user: username, password, email (required length of the user input is not more than 20 characters, if more than only the first 20 characters are valid)

If the user enters q or Q represents no longer continue to enter, the user inputs the rich content printed in tabular form

Guess you like

Origin www.cnblogs.com/jianchixuexu/p/11442003.html
Recommended