2026年金融科技校招面试题及答案.docxVIP

  • 1
  • 0
  • 约3.38千字
  • 约 11页
  • 2026-07-22 发布于福建
  • 举报

第PAGE页共NUMPAGES页

2026年金融科技校招面试题及答案

一、编程能力测试(共3题,每题10分,总计30分)

题目1(Python编程):

请用Python编写一个函数,实现以下功能:

1.输入一个字符串(包含数字和字母),统计其中数字和字母的数量;

2.将数字和字母分别按降序排列,并输出结果。

例如,输入Tech2026Fin,输出:数字总数3,字母总数6,数字降序排列6420,字母降序排列TecHhino。

答案:

python

defcount_and_sort(s):

digits=[cforcinsifc.isdigit()]

letters=[cforcinsifc.isalpha()]

digit_count=len(digits)

letter_count=len(letters)

digits_sorted=.join(sorted(digits,reverse=True))

letters_sorted=.join(sorted(letters,reverse=True))

returnf数字总数{digit_count},字母总数{letter_count},数字降序排列{digits_sorted},字母降序排列{letters_sorted}

测试

print(count

文档评论(0)

1亿VIP精品文档

相关文档