python 关于候选人面试的一些注意事项

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 关于候选人面试的一些注意事项相关的知识,希望对你有一定的参考价值。

vowels = 'aeiou'
words  = %w(apple  orange  pear  milk  otter  snake iguana tiger eagle)

index = 0
words.each do |word|
  word.each_char do |char|
    if vowels.include? char
      char = char.upcase
      word[index] = char
    end
    index += 1
  end
  index = 0
end

p words
p words == ["ApplE", "OrAngE", "pEAr", "mIlk", "OttEr", "snAkE", "IgUAnA", "tIgEr", "EAglE"]
vowels = 'aeiou'
words  = "apple  orange  pear  milk  otter  snake iguana tiger eagle".split()

def swap_vowels(word):
  index = 0
  for char in word:
    if char in vowels:
      word = word[:index] + char.upper() + word[index+1:]
    index += 1
  return word

ww = map(lambda w: swap_vowels(w), words)
out = list(ww)

print(out)
print(out == ["ApplE", "OrAngE", "pEAr", "mIlk", "OttEr", "snAkE", "IgUAnA", "tIgEr", "EAglE"])

以上是关于python 关于候选人面试的一些注意事项的主要内容,如果未能解决你的问题,请参考以下文章

注意:程序员面试的标准答案一定正确吗?

Python面试中需要注意的几点事项!

面试java后端开发之后的一些感受

面试官:你知道Dubbo怎么做优雅上下线的吗?你:优雅上下线是啥?

作为测试开发岗的面试官,我都是怎么选人的?

面试大厂回来后,有一些话想对 Java 后端开发说一说