you have to make function for fizzbuzz game, the instruction is every multiple 3 have to change number to"fizz" and every multiple 5 have to change number to "buzz", and while number multiple by 15 have to change "fizzbuzz"
def fizzbuzz(n):
pass
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
Write a program to display a series of odd numbers from 1 to 20.
Instructions:
Use the for loop concept to iterate the number.
Use the if concept to check whether the number is odd or not and change to "odd number".
Display the number.
def odd_number(x):
return x
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
you have to make band name generator using that parameter. using random module
def band_name_generator(city, pet):
return city + pet
import codewars_test as test
# TODO Write tests
import solution # or from solution import example
# test.assert_equals(actual, expected, [optional] message)
@test.describe("Example")
def test_group():
@test.it("test case")
def test_case():
test.assert_equals(1 + 1, 2)
import codewars_test as test from solution import gimme_honor @test.describe("Example") def test_group(): @test.it("test case") def test_case(): test.assert_equals(gimme_honor(), True)