<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          測試工程師之Python面試題(附答案)

          共 504字,需瀏覽 2分鐘

           ·

          2022-05-31 21:17

          1、請把字符串“abcde”里面的字符,逐個,打印出來


          ss="abcdefgh"

          for i in ss:

          ? ? print(i)


          2、對字符串“www.autotestplat.com",輸出為“com.autotestplat.www"


          ss = "www.autotestplat.com"

          list_ss = list(ss.split('.'))?

          list_ss.reverse()

          print(".".join(list_ss))



          3、把一個列表里面的數(shù)字元素,去重,如 {1,1,2,2,3,3,4,4,5,5}


          aa = [1,1,2,2,3,3,4,4,5,5,5]

          bb = list(set(aa))

          print(bb)?



          4、用遞歸實現(xiàn)數(shù)字的階乘,N!,n=9時,s=9*8*7*6*5*4*3*2*1


          def a(n):

          ? ? if int(n)<= 1:

          ? ? ? ??return 1

          ? ? else:

          ? ? ? ? return n*a(n-1)

          print(a(9))




          5、對字符串

          ? ? ? {"a":"0","b":"1","d":"11","e":"22","f":"33"},?

          ? ??輸出字典?{'a':'1','b':'1','d':'11','e':'22','f':'33'}


          ss= '{"a":"0","b":"1","d":"11","e":"22","f":"33"}'

          dict_ss = eval(ss)

          print(dict_ss)



          6、以下代碼:

          ?? ? ?a="05550550"

          ? ? ? print(a.index("x")

          ? ? ? 運行結(jié)果是:


          ValueError: substring not found



          7、以下幾行字符串

          ? ? ? ? ?? ? fin one ?:13700010001 15 52A

          ? ? ? ? ? ? ?fin two ?:13700020002 15 52B

          ? ? ? ? ? ? ?fin three:13700030003 15 52C

          ? ?依次代表?姓名 :手機號 ? 樓棟號? 房間號

          ? ?請輸出

          ? ?姓名 :...,電話:...........,住址:......

          ???姓名 :...,電話:...........,住址:......

          ???姓名 :...,電話:...........,住址:......


          str1 = 'fin one :13700010001 15 52A'

          str2 = 'fin two :13700020002 15 52B '

          str3 = 'fin three:13700030003 15 52C'?

          a1 = str1.split(':')? ?

          a11 = a1[1].split(' ')

          a2 = str2.split(':')? ?

          a22 = a2[1].split(' ')

          a3 = str3.split(':')? ?

          a33 = a3[1].split(' ')

          print("姓名:"+a1[0]+",電話:"+a11[0]+",住址:"+a11[1]+" "+a11[2])

          print("姓名:"+a2[0]+",電話:"+a22[0]+",住址:"+a22[1]+" "+a22[2])

          print("姓名:"+a3[0]+",電話:"+a33[0]+",住址:"+a33[1]+" "+a33[2])



          8、實現(xiàn)一個冒泡排序

          data = [2,10,7,8,9,5,4,1]

          def bubble_sort(arr):?

          ? ? for i in range(len(data)-1):

          ? ? ? ? for j in range(len(data)-1-i):

          ? ? ? ? ? ? if data[j]>data[j+1]:

          ? ? ? ? ? ? ? ? data[j+1],data[j]=data[j],data[j+1]

          ? ? return? data? ?

          print(bubble_sort(data))?

          瀏覽 90
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  久久免费丝袜足交视频 | 午夜美女内射黄操操射精网站大胸操逼 | 精品人妻无码视频 | 国产精品伦理久久久久 | 日逼观看视频 |