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
Thepotemich [5.8K]
3 years ago
13

The following program is supposed to display a message indicating if the integer entered by the user is even or odd. What is wro

ng with the program?
num = int(input("Enter an integer: "))
print("The integer is", evenOdd(num))
def evenOdd(n) :
if n % 2 == 0 :
return "even"
return "odd"
A. The function definition must appear before the function is called.
B. The input and print statements must reside in a function named main.
C. The variable num and the parameter variable n must have the same name.
D. An else clause must be added to the if statement.
Computers and Technology
1 answer:
Lapatulllka [165]3 years ago
6 0

Answer:

A. The function definition must appear before the function is called

Explanation:

Given

The above lines of code

Required

Determine the error in the program

In python, functions has be defined before they are called but in this case (of the given program), the function is called before it was defined and this will definitely result in an error;

<em>Hence, option A answers the question</em>

The correct sequence of the program is as follows:

<em>def evenOdd(n): </em>

<em>      if n % 2 == 0: </em>

<em>            return "even" </em>

<em>      return "odd" </em>

<em>num = int(input("Enter an integer: ")) </em>

<em>print("The integer is", evenOdd(num)) </em>

<em />

You might be interested in
Sean is white hat hacker, who is demonstrating a network level session hijack attacks and as part of it, he has injected malicio
solong [7]

Answer:

The following network level session hijacking attack shown by Sean is Blind Hijacking, LETTER C.

Explanation:

<em>Because he is injecting malicious data or commands into the intercepted communications in the TCP session even if the source-routing is disabled. He can send the data or commands but hass no access to see the response.</em>

3 0
4 years ago
Please help ⊙﹏⊙ thank you &lt;3
mr_godi [17]

Answer:1. the importance of preventing maintenance is to advoid injuries or harm

2.true

Explanation:

5 0
3 years ago
Read 2 more answers
True or false with reason :- carriage inword is carriage on purchases​
Vlada [557]

Answer:

True

Explanation:

Carriage on purchases is carriage inward. Explanation: Carriage inwards refers to the transportation costs required to be paid by the purchaser when it receives merchandise it ordered with terms FOB shipping point. Carriage inwards is also known as freight-in or transportation-in.

:)

8 0
3 years ago
____ is a consistent relational database state in which every foreign key value also exists as a primary key value.​ a. ​ Refere
maria [59]

Answer:

The correct answer is Option A (Referential integrity)

Explanation:

When a relational database table is in ​first normal form, that means it has no repeating fields or groups of fields, and hence all rows have the same columns, while if a relational database table is in second normal form, it implies that every non-key field is functionally dependent on the primary key. If can be in the third normal form if no non-key field is functionally dependent on any other non-key field.​

A relational database on its own is a universal approved database model whose data is stored in tables divided into records and fields that serve as an information unit that organizes data points for easy access.

In the relational database, foreign keys are being checked to reference the primary key and enforce referential integrity so as to ensure that the foreign key must have a matching primary key. It means the reference from a row in one table to another table must be valid. Referential integrity concerns the concept of a foreign key normally enforced by the database management system.

4 0
3 years ago
Why were low quality video so often use when Internet connection we’re poorer than they are today
kakasveta [241]
What do you mean? I’m confused with the question, it doesn’t make sense:)
8 0
3 years ago
Other questions:
  • which type of website would a business selling merchandise on the internet use? A person B information C commercial D social
    9·1 answer
  • An attempt to exploit a vulnerability of a computer or network component is the definition of ________.
    15·2 answers
  • The chain of command is an unbroken line of authority that extends from the top of the organization to the lowest echelon and cl
    7·1 answer
  • What date does GTA 6 come out<br> A. 2020<br> B. 2019<br> C. 2021<br> D. 2022
    10·2 answers
  • Where are some places that cyberbullying occurs? Check all that apply.
    15·1 answer
  • What are some disadvantages of using a word processor over a type writer?​
    7·1 answer
  • Use the drop-down menus to complete statements about options for inserting video files.
    15·1 answer
  • Why do we use compliment method?
    13·2 answers
  • Questlon 5 of 25
    5·1 answer
  • A computer lacks a division instruction and performs iteratively using the technique described on page 300. suppose we wish to e
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!