随笔分类 - 待分类 / 05_题目练习 / 05_Python题目练习 / Codewars
Codewars练习笔记
摘要:# Description In this kata you will create a function that takes a list of non-negative integers and strings and returns a new list with the strings f
阅读全文
摘要:Instructions Create a function that takes an integer as an argument and returns "Even" for even numbers or "Odd" for odd numbers. Solution def even_or
阅读全文
摘要:Count of positives / sum of negatives Given an array of integers. Return an array, where the first element is the count of positives numbers and the s
阅读全文
摘要:Details An isogram is a word that has no repeating letters, consecutive or non-consecutive. Implement a function that determines whether a string that
阅读全文
摘要:Instructions Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string). Solutio
阅读全文
摘要:Summation Write a program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0. For exa
阅读全文
摘要:Instructions Complete the method that takes a boolean value and return a "Yes" string for true, or a "No" string for false. Solution def bool_to_word(
阅读全文
摘要:DESCRIPTION: Return the number (count) of vowels in the given string. We will consider a, e, i, o, u as vowels for this Kata (but not y). The input st
阅读全文
摘要:Given an array of integers ```nums``` and an integer ```target```, return indices of the two numbers such that they add up to ```target```. You may as
阅读全文
摘要:Instructions Trolls are attacking your comment section! A common way to deal with this situation is to remove all of the vowels from the trolls' comme
阅读全文
摘要:DESCRIPTION You're writing code to control your town's traffic lights. You need a function to handle each change from green, to yellow, to red, and th
阅读全文
摘要:Instructions Create a function that gives a personalized greeting. This function takes two parameters: name and owner. Use conditionals to return the
阅读全文
摘要:Instructions It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one p
阅读全文
摘要:Instructions Create a function with two arguments that will return an array of the first n multiples of x. Assume both the given number and the number
阅读全文
摘要:Instructions Create a function which answers the question "Are you playing banjo?". If your name starts with the letter "R" or lower case "r", you are
阅读全文
摘要:Instructions Given an array of integers your solution should find the smallest integer. For example: Given [34, 15, 88, 2] your solution will return 2
阅读全文
摘要:Instructions Write a function that takes an array of words and smashes them together into a sentence and returns the sentence. You can ignore any need
阅读全文
摘要:Instructions Complete the square sum function so that it squares each number passed into it and then sums the results together. For example, for[1, 2,
阅读全文
摘要:Introduction The first century spans from the year 1 up to and including the year 100, the second century - from the year 101 up to and including the
阅读全文
摘要:Instructions Write function bmi that calculates body mass index (bmi = weight / height2). if bmi <= 18.5 return "Underweight" if bmi <= 25.0 return "N
阅读全文

浙公网安备 33010602011771号