lundi 18 septembre 2017

Using tests to run python

**Here is the solution phase of the Qualified Assessment** 

# Complete this function to return either "Hello, [name]!" or "Hello there!" based on the input

def say_hello(name):

  # you can print to STDOUT to debug if you need to:

  print(name)


  # but to complete the challenge you need to return a value

  name # TODO: return correct value

Here is the sample test phase

import unittest

# These example test cases are editable, feel free to add your own tests to debug your code.

# Note: the class must be called Test

class Test(unittest.TestCase):
  def test_should_say_hello(self):
    self.assertEqual(say_hello("Qualified"), "Hello, Qualified!")

Aucun commentaire:

Enregistrer un commentaire