Answer:
The program written in python is as follows:
def begins_with_line(userinut):
while userinut[0] == '-' or userinut[0] == '_':
print(bool(True))
break;
else:
print(bool(not True))
userinput = input("Enter a string: ")
begins_with_line(userinput)
Step-by-step explanation:
The program makes use of no comments; However, the line by line explanation is as follows
This line defines the function begins_with_line with parameter userinut
def begins_with_line(userinut):
The following italicized lines checks if the first character of user input is dash (-) or underscore ( _)
while userinut[0] == '-' or userinut[0] == '_':
print(bool(True)) ->The function returns True
break;
However, the following italicized lines is executed if the first character of user input is neither dash (-) nor underscore ( _)
else:
print(bool(not True)) -> This returns false
The main starts here
The first line prompts user for input
userinput = input("Enter a string: ")
The next line calls the defined function
begins_with_line(userinput)
NB: The program does not make use of if statement