Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
10327 views
ubuntu2004
Kernel: Python 3 (system-wide)

Exercise 19.1

Write a function called string_length() that prints the length of the word "Hello". Don't forget the doc-string.

def string_length(): '''Prints the lengh to a word "Hello"''' print(len('Hello')) string_length()
5

Exercise 19.2

Write a function called hello_me() that asks for input of your name then prints "Hello" followed by your name.

def hello_me(): name = input() print(f'Hello {name}') hello_me()
Hello A

Exercise 19.3

Write a function called multiply_two_numbers() that asks for input of two numbers and then prints their product.

def multiply_two_numbers(): x = int(input()) y = int(input()) sum = x * y print(sum) multiply_two_numbers()
10