No intention to see the old boy's blog: qualified Linux OPS personnel will be the 30-way shell programming surface questions and explanations
http://oldboy.blog.51cto.com/2561410/1632876
Try to use the first Python to answer some, right when practiced hand!
If there are errors, please criticize!
# Enterprise Face question 28, write a isosceles triangle (oldboy2_triangle.sh) with the shell or Python and receive the number entered by the user.
For example
# [email protected] ~]# sh oldboy2_triangle.sh
# please Enter a number:5
#0 *
#1 * * *
#2 * * *
#3 *******
#4 *********
#输入的数字表明有多少行数; #如果用户输入的是5 (0-4), M: the number of #第n行的 * is 2n-1# arrangement method is M-n space plus 2n-1 *m=int (input ("Plz input a num:")) for N in range (m ): s= (m-n) * "" + (2*n-1) * "*" Print (s)
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8C/F2/wKioL1h_RxvCeWMJAAAsxoUpTfQ899.png-wh_500x0-wm_3 -wmp_4-s_1751352481.png "title=" 1.png "alt=" Wkiol1h_rxvcewmjaaasxouptfq899.png-wh_50 "/>
Python Exercise 28