Basic function call get_pattern() returns 5 characters. Call get_pattern() twice in a print() statement to return and print 10 characters. Example output: ***** *****
def get_pattern():
return '*****'
print('*****')
print('*****')
get_pattern()
get_attern()
Testing pattern returned was printed twice.
Your output
*****
*****
Testing with different character. Output differs. See highlights below.
Your output
*****
*****
Expected output
#####
#####

Answer :

Answer:

get_pattern()

get_pattern()

print(get_pattern())

print(get_pattern())

Explanation:

MrRoyal

The program is given in Python; this means that it must be completed in Python.

The code segment that completes the program is:

print(get_pattern())

print(get_pattern())

From the complete question, the given code segment is:

def get_pattern():

    return '*****'

The above function will only return 5 characters i.e. 5 *'s, but it will never print the characters.

For the characters to be printed, a print statement must be introduced when calling the function get_pattern()

So, the print statement will be:

print(get_pattern())

The question requires 10 characters; so, the print statement must be called twice.

Hence, the code segment that completes the program is:

print(get_pattern())

print(get_pattern())

Read more about Python programs at:

https://brainly.com/question/22841107

Other Questions