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
Ilia_Sergeevich [38]
3 years ago
15

What does this mean in python?

Computers and Technology
1 answer:
scoundrel [369]3 years ago
8 0

the comments in the code should explain everything, brainly's formatting might be weird


gate = raw_input("Enter logic gate :").upper()#.upper() so lower/upper case of input doesn't matter

firstInput = raw_input("Enter first input :")#raw_input() for python 2.7, input() for 3

secondInput = raw_input("Enter second input :")

if (firstInput!="0" and firstInput!="1") or (secondInput!="0" and secondInput!="1"):

print("inputs must be 0 or 1")#ensure all inputs are in boolean range

quit()


firstInput=firstInput=="1"#convert "1" to true and "0" to false

secondInput=secondInput=="1"


if gate=="AND" or gate=="NAND":

result=firstInput and  secondInput

elif gate=="OR" or gate=="NOR":

result=firstInput or secondInput

elif gate=="XOR":

result=firstInput!=secondInput

else:#handle case of unknown/mistyped gates

print(gate+" is not known")

quit()

if gate=="NOR" or gate=="NAND":

result=not result#invert result for nor and nand

print("Result = "+str(int(result)))#uses int so 1/0 are printed instead of True/False


You might be interested in
____ is an iterative software development process that focuses on team productivity and delivers software best practices to all
cluponka [151]

Answer:

RUP

Explanation:

RUP or Rational Unified Process is an IBM's software that divides the development process in four phases. It was developed to work throughout the entire software development life cycle, it's adaptive.

I hope you find this information useful and interesting! Good luck!

5 0
3 years ago
What is a programming language?
xenn [34]
D is the answer cause coding
5 0
2 years ago
Read 2 more answers
These tools gather information from sources such as emails, text messages, and tweets and make the information instantly and pub
babunello [35]

Answer:

Crisis-Mapping

Explanation:

Social networks are characterized by the immediacy of the content that users produce, and that same feature can be transferred to the online mapping of crises and conflicts.

Characteristics Crisis-Mapping:

  • Real-time information processing.
  • Immediacy;
  • Visualization of the aggregated information can allow the detection of patterns that cause new analyzes to be undertaken or work hypothesis to verify.
  • Continuity in the tasks, the maps record activity without interruption during the twenty-four hours of the day and seven days per week.
  • Flexibility in the protocols, since the tasks are distributed and evolve according to the dynamics (the crisis maps evolve with the crisis itself).
8 0
3 years ago
Why do businesses often provide a logo on their web pages?
Nitella [24]
<span>B. They provide viewers with a consistent visual reminder of their company.

This is a prevalent example of branding.</span>
7 0
3 years ago
Type which type of interference we will install after installing operating system​
pentagon [3]

Answer:

There are different kinds of operating systems: such as Windows, Linux and Mac OS

There are also different versions of these operating systems, e.g. Windows 7, 8 and 10

Operating systems can be used with different user interfaces (UI): text user interfaces (TUI) and graphical user interfaces (GUI) as examples

Graphical user interfaces have many similarities in different operating systems: such as the start menu, desktop etc.

When you can recognize the typical parts of each operating system’s user interface, you will mostly be able to use both Windows and Linux as well as e.g. Mac OS.

THE ROLE OF OPERATING SYSTEM IN THE COMPUTER

An operating system (OS) is a set of programs which ensures the interoperability of the hardware and software in your computer. The operating system enables, among other things,

the identification and activation of devices connected to the computer,

the installation and use of programs, and

the handling of files.

8 0
3 years ago
Other questions:
  • Which presenter would most likely benefit from a custom slide show?
    10·2 answers
  • You can precede a subquery with the ___ operator to create a conditiion that is true if one or more rows are obstained when the
    10·1 answer
  • Carly is part of a community of developers. In her free time, she works on code to improve this open-source operating system. Th
    11·1 answer
  • An information security ________ is a specification of a model to be followed during the design, selection, and initial and ongo
    11·2 answers
  • Communications that take the form of electronic junk mail or unsolicited e-mail are referred to as
    13·2 answers
  • Symbic Foods, a chain of fast food restaurants, has included a drop-down menu on its main Web site. With this drop-down menu, pe
    13·1 answer
  • The purpose of a software design is to enable programmers to implement the requirements by designating the projected parts of th
    14·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    15·2 answers
  • Ten examples of an interpreter
    8·1 answer
  • Using an outline, how do you maintain your computer or cellphone​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!