2017 the last day, in the QC Inculcation, I finally wrote (back) six questions, the basic syntax of Python has a general understanding.
1, A+b+c
Just to practice the input, Line=input (). Split () into the list, split open to assign to A,b,c, don't forget to turn int
2. The problem of removing surplus
As with the previous question, there is a% redundancy and a simple if condition selection.
3. Judging prime numbers
There is an import imported into the math package, and a DEF definition function, M.SQRT (x) is the root of x, with a for to traverse, range () left closed right, and if statement ellipsis (true is executed).
4. Matrix flipping
This problem is the most difficult, in order to talk about this problem, QC back to me a two-dimensional array demonstration, moved ing~
Expand Mat by Line=[[]]*m, expand by column, enter data, then swap mat[j][i], Mat[j][n-1-i]=mat[j][n -1-i],mat[j][i], the same can be up and down. The output is a traversal.
5. Duplicate elements in the migration group
The use of Set element non-repeatability
6, the length of the last letter
Output list the length of the second element with print (line[-1].__len__ ())
Finally thanks to QC, you are the best and most powerful father in the world ~
Python First Experience