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
snow_lady [41]
2 years ago
9

Write a program that takes a string as an input. If the string entered is equal to

Computers and Technology
1 answer:
Ivenika [448]2 years ago
3 0

The program could be written using a python script.

<h3>Python script on string operation</h3>

The program takes a string as an input. First, declare a variable for the input:

var = str()

#The above code will ask for a string to be inputted

Next would be to condition the script in a particular direction using the 'if' statement. That is, a Boolean function.

if var ==('chicken'):

#The above code will compare the inputted string to the word 'chicken'.

  print("This is equal")

#The screen will display 'This is equal' if the inputted stringis the same as 'chicken'.

else:

  print("This is not equal")

#The screen will display "This is not equal" if the inputted string is not the same as 'chicken'.

In summary, the code goes thus:

var = str()

if var ==('chicken'):

   print("This is equal")

else:

   print("This is not equal")

More on python scripts can be found here: brainly.com/question/14378173

#SPJ1

You might be interested in
An office employee working in a payroll department uses a customized program to log hours employees have worked. The customized
Slav-nsk [51]
The answer is Software.
7 0
3 years ago
Read 2 more answers
Which graphic file format would you choose if you needed to make an animated graphic for a website?
kipiarov [429]

Answer:

GIF – Graphics Interchange Format

Explanation:

3 0
2 years ago
When we look for errors inside of our code on our own or with a partner , what is that called?
lutik1710 [3]
It’s called that he is cheating
6 0
2 years ago
Read 2 more answers
Please answer the following in python: Answering the ones that have #TODO
zalisa [80]

Answer:

Please answer the following in python: Answering the ones that have #TODO

from DiceQuad import DiceQuadclass PigPlayer:

WINNING_SCORE = 100

AUTO_WIN_RECOGNITION_ON = True

numPlayers = 0

def __init__(self, owner, name = "Player"):

self.owner = owner

self.name = name

self.dice = DiceQuad()

self.score = 0

self.roundScore = 0

self.isPlayerTurn = False

PigPlayer.numPlayers += 1

def reset(self):

''Resets all player values to their default value at the start of a game''

#TODO

pass

def getName(self):

'''Return the name of the player'''

return self.name

def getCurrentScore(self):

'''Return the current score of the player. If it is currently the player's turn,

include the round score'''

#TODO

pass

def hasWon(self):

'''Return boolean if the player has won'''

#TODO

pass

def __str__(self):

'''String representation of this class is the current total score, along with the

current round score (which could still be lost, in the case the turn is still

on), or the last round score, if it's the other player's turn'''

return (self.name + "\'s score: \t" + str(self.getCurrentScore()) + "\t"+

(" (this round so far: " if self.isPlayerTurn else " (last round's score: ")+ "\t" + str(self.roundScore) + ")")

def displayNum1s(self):

'''Prints a message about how many 1s were rolled. Also prints what happens as a consequence.

EX:

Player 1 rolled 3 ones

Player 1 loses all points'''

num1s = self.dice.num1s()

print(self.name + " rolled " + str(num1s) + " ones")

if(num1s == 1):

#TODO

pass

elif(num1s == 2):

#TODO

pass

elif(num1s == 3):

#TODO

pass

elif(num1s == 4):

#TODO

pass

def displayDice(self):

print(self.dice)

def displayDoRoll(self):

self.owner.displayScores()

print(self.name + " rolls... ")

def doRoll(self):

'''Rolls the dice for the player. Based on the number of 1s left, either asks the player if they want to roll again

or ends the turn with the proper consequence. If AUTO_WIN_RECOGNITION_ON is True, ends the turn automatically when

player has won including the most recent roll'''

self.displayDoRoll()

self.dice.roll()

self.displayDice()

num1s = self.dice.num1s()

if(num1s == 0):

#TODO

pass

elif(num1s == 1):

#TODO

pass

elif(num1s == 2):

#TODO

pass

elif(num1s == 3):

#TODO

pass

elif(num1s == 4):

#TODO

pass

def doTurn(self):

'''Performs a full turn for the player'''

self.roundScore = 0

self.isPlayerTurn = True

while (self.isPlayerTurn):

self.doRoll()

if(self.isPlayerTurn):

self.isPlayerTurn = not self.wantsHandOver()

self.score += self.<em><u>roundScorenxnd</u></em><em><u> </u></em><em><u>dd</u></em>

5 0
2 years ago
A customer states that when she removes the printed pages from her laser printer output tray, the black ink smears all over her
luda_lava [24]

Answer:

B. Fuser unit

Explanation:

Based on the scenario that is being described it can be said that the most likely problem is the Fuser unit. This is a part that plays an important role in the printing process. This unit melts the toner and compresses it in order to leave the impression on the paper with heat. A faulty fuser unit will not compress correctly and leave wet ink on the paper causing it to smear.

7 0
3 years ago
Other questions:
  • Which social media marketing concept engages visitors, getting them to revisit your website and tying them to offline events for
    7·2 answers
  • would specify that only selected members of the payroll and human resources department would have the right to change sensitive
    11·1 answer
  • The concept of plug and play" is demonstrated by which of the following
    15·1 answer
  • The front surface of the CCD is called the _________
    11·1 answer
  • ____ is high-quality encryption software that has become quite popular for creating secure e-mail messages and encrypting other
    9·1 answer
  • Today encoding scheme has taken over ascII by what
    5·1 answer
  • What is a mortgage?
    8·2 answers
  • java Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins w
    11·1 answer
  • A style sheet consists of CSS ______________________ that specify the layout and format properties to apply to an element. *
    13·1 answer
  • Animals living in burrows under the ground is an interaction between the biosphere and the
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!