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
Lynn wants to share parts of an essay she wrote in her slide presentation
fgiga [73]

Answer:

no

Explanation:

No she should not  because it might be for a test

6 0
2 years ago
______ databases find the name and department name of all graduate students who work on projects that do not employ any other gr
yawa3891 [41]

Structured Query Language databases find the name and department name of all graduate students who work on projects that do not employ any other graduates from their department.

Explanation:

Structured Query Language (SQL) is a database-style intended for managing data kept in a relational database management system. SQL statements are applied to execute jobs such as update data on a database or recover data from a database. The standard SQL commands such as "Select", "Insert", "Update", "Delete", "Create", and "Drop" can be used to perform virtually everything that one requires to do with a database. According to ANSI (American National Standards Institute), it is the approved language for relational database management systems.

7 0
3 years ago
Describe two benefits of the community of replacing the printed copy with an online version.
DiKsa [7]

Answer:

less costs

Explanation:

saves more money

easy to use for everyone

6 0
3 years ago
You need to apply security settings to the registry on a Windows server. Which command should you use
Mekhanik [1.2K]

There are different kinds of measures taken in security. The command should you use is   Certutil.

<h3>What is Certutil</h3>

Lawrence Abrams was known to be the man that mad Windows to have a built-in program called CertUtil.

This is often used to manage certificates in Windows where one can install, backup, delete, manage, and perform a lot of functions related to certificates and certificate that are saved in Windows.

See full question below

You need to apply security settings to the registry on a Windows server. Which command should you use?

certutil

regedit

regex

cipher

Learn more about Certutil from

brainly.com/question/24931496

7 0
2 years ago
Which of the following statements correctly instantiate the Rectangle object myRectangle? (i) myRectangle Rectangle = new Rectan
madreJ [45]

Answer:

The answer is "option iii"  .

Explanation:

In the given question it is defined that a class "Rectangle" is defined in the class a parameter constructor is created that accepts two parameters. In this question, we create an instance of the class. In object creation first, we define class name then object name and use new keyword in the Instance of class and pass parameters.

  • In option i), An object name is used first and then class name. It is not correct.
  • In option ii), In instance creation of the class, we do not use class keyword that's why it is wrong.

5 0
4 years ago
Read 2 more answers
Other questions:
  • Which of the following describes a poor design consideration for a form?
    14·1 answer
  • If you have cable internet service, what protocol is used between the head end connection and the cable company's network
    8·1 answer
  • Your company leases a very fast internet connection and pays for it based on usage. You have been asked by the company president
    8·1 answer
  • What are some examples of how AutoFormat can convert text as you type? Check all that apply.
    8·1 answer
  • Which option should you select to accept a tracked change? A. Accept B. Reject C. Review D. Delete
    8·2 answers
  • How do you change the number of rows and columns displayed for an embedded Excel object on a PowerPoint slide?
    8·1 answer
  • CC stand for.....in the email platform?
    12·2 answers
  • How does a fully integrated Data and Analytics Platform enable organizations to convert data into consumable information and ins
    15·1 answer
  • What is the difference between concrete language and abstract language? give an example of each.
    14·1 answer
  • give the tightest asymptotic bounds you can for the following recurrences and provide a short explanation for your solution. you
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!