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)
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 ( _)
<em> while userinut[0] == '-' or userinut[0] == '_':
</em>
<em> print(bool(True)) </em><em>->The function returns True</em>
<em> break;
</em>
<em>However, the following italicized lines is executed if the first character of user input is neither dash (-) nor underscore ( _)</em>
<em> else:
</em>
<em> print(bool(not True)) </em><em>-> This returns false</em>
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)
<u><em>NB: The program does not make use of if statement</em></u>