1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mart [117]
3 years ago
15

Define a function begins_with_line that consumes a string and returns a boolean indicating whether the string begins with a dash

('-') or a underscore '_'. For example, the string "-Yes" would return True but the string "Nope" would return False. Note: Your function will be unit tested against multiple strings. It is not enough to get the right output for your own test cases, you will need to be able to handle any kind of non-empty string. Note: You are not allowed to use an if statement.
Computers and Technology
1 answer:
Ksju [112]3 years ago
8 0

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>

You might be interested in
In pre-shared key mode, a passphrase should be at least ________ characters long.
alexandr402 [8]
10.......................................

8 0
3 years ago
As text is typed in the _____ text box, a drop-down list displays options for completing the action, displaying information on t
pickupchik [31]

Answer:

Excel Help

Explanation:

Press F1 key to open the excel help window

Or you can also click the excel help button to launch the help window.

Type for whatever you are seeking help for and you will notice suggestions as you type something. These suggestions include online and offline results. If there are too many results then try searching offline it will narrow down the results.

After typing the text and hitting enter, the excel help returns several related topics on the searched query. You can browse through these topics and get help from excel.

5 0
3 years ago
Reading view is similar to ____ view because each slide displays individually, but the slides do not fill the entire screen.
Akimi4 [234]
Reading view is similar to (SLIDE VIEW) because each slide displays individually, but the slides do not fill the entire screen.
Slide view is the presentation of images or data in a projector screen that makes it bigger and visible.
7 0
3 years ago
A(n) ____ stores a query and is used to access data in the underlying tables.
choli [55]
A cross tab query is good in data assessment
 in any underlying tables.
<span />
7 0
3 years ago
Create a security management policy that addresses the management and the separation of duties throughout the seven domains of a
klio [65]

Seven Domains of IT Infrastructure Seven domains can be found in a typical IT infrastructure. They are as follows: User Domain, Workstation Domain, LAN Domain, LAN-to-WAN Domain, Remote Access Domain, WAN Domain, and System/Application Domain.

Explanation:

User Domain : The User Domain covers all theusers (of any rank) that haveaccess to the other six domains.

RISKS:

  • User can destroy data in application(intentionally or not) and delete all
  • User can insert infected CD or USBflash drive into the work computer

Workstation Domain : A computer of an individual user where the production takes place

RISKS:

  • The workstation’s OS can have a known software vulnerability thatallows a hacker to connect remotelyand steal data.
  • A workstation’s hard drive can fail causing lost data

LAN Domain : Contains all of the workstations,hubs, switches, and routers. TheLAN is a trusted zone

RISKS:

  • A worm can spread through the LANand infect all computers in it.
  • LAN server OS can have a knownsoftware vulnerability.

WAN Domain : Stands for Wide Area Network and consists of the Internet and semi-private lines

RISKS:

  • Service provider can have a major network outage.
  • Server can receive a DOS or DDOS attack.
  • A FTP server can allow anonymously uploaded illegal software

LAN / WAN Domain : The boundary between the trusted and un-trusted zones.The zones are filtered with a firewall

RISKS:

  • Weak ingress/egress traffic filteringcan degrade performance.
  • A firewall with unnecessary portsopen can allow access from the Internet

System / Application Storage Domain : This domain is made up of user-accessed servers suchas email and database

RISKS:

  • A fire can destroy primary data
  • A DOS attack can cripple the organization’s email

Remote Access Domain  :The domain in which a mobileuser can access the local network remotely, usually through a VPN

RISKS:

  • Communication circuit outage candeny connection.
  • Remote communication from officecan be unsecured.
  • VPN tunneling between remotecomputer and ingress/egress routercan be hacked
6 0
3 years ago
Other questions:
  • How do smart watches affect the business and its position in the global marketplace?
    12·2 answers
  • In a Web-based database, middleware is used to transfer information from the organization's internal database back to the Web se
    12·1 answer
  • Which software application offers a variety of templates for creating reports, flyers, and newsletters that you can access withi
    12·1 answer
  • Create a program that simulates a race between several vehicles. Design and implement an inheritance hierarchy that includes Veh
    11·1 answer
  • Which of these is system software? Check all
    14·1 answer
  • When you check your hard drive to see how much space is available, you are checking your
    15·1 answer
  • A task-oriented leader is ideal for a creative workplace.
    8·2 answers
  • Have some points part 6<br>anyone know how to change my username?​
    11·2 answers
  • Please fill in I give 50 points!!
    13·1 answer
  • Why isn't image display working on wacom tablet.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!