You can download this code by clicking the button below.
This code is now available for download.
This function takes a parameter 'name' and returns a random greeting followed by the user's name.
Technology Stack : Python, Robot Framework, BuiltIn Library
Code Type : Python Function
Code Difficulty :
import random
import json
from robot.libraries.BuiltIn import BuiltIn
def generate_random_greeting(name):
greetings = ["Hello", "Hi", "Hey", "G'day", "Yo"]
return random.choice(greetings) + " " + name + "!"