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
A common attack in which a client's cookies, security tokens, or other personal information is obtained and used to impersonate
o-na [289]

Answer:

Identity Theft. i hope this helps :D

5 0
3 years ago
write HTML code to create a web page which will contain a title my favourite book as a centralised heading feluda somogro and bo
Trava [24]

Answer:

Satyajit Ray (1921–1992), a Bengali film director from India, is well known for his contributions to Bengali literature. He created two of the most famous characters in Feluda the sleuth, and Professor Shonku the scientist. He wrote several short novels and stories in addition to those based on these two characters. His fiction was targeted mainly at younger readers (mostly teenagers) , though it became popular among children and adults alike.



Ray during recording of his film Pather Panchali

Most of his novels and stories in Bengali have been published by Ananda Publishers, Kolkata; and most of his screenplays have been published in Bengali in the literary journal Ekshan, edited by his close friend Nirmalya Acharya. During the mid-1990s, Ray's film essays and an anthology of short stories were also published in the West. Many of the stories have been translated into English and published.

3 0
2 years ago
How many channels can the 2.4 GHz band be divided into?
wlad13 [49]

Answer:Fourteen channels

Explanation:

8 0
2 years ago
Chris has received an email that was entirely written using capitalization. He needs to paste this text into another document bu
dem82 [27]

Select the text you want to alter.

Press Shift+F3. Word changes the case of the selected text.

Continue pressing Shift+F3 until the case is the way you want it.

hope this helps

8 0
3 years ago
Read 2 more answers
The envelope method, notebook and pencil, and online software are all methods of ______.
coldgirl [10]

Answer:

communication

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • Melissa and Sue want to show a presentation to twenty employees using a presentation while using a projector. They learn that th
    12·2 answers
  • A _________ is a copy of one or more files (or entire storage devices) that is made in case the originals become lost or damaged
    5·1 answer
  • How hot is to hot for my computer?
    11·2 answers
  • Identify a stressor in your life. Conduct an internet search to locate at least two reliable sources of information on effective
    6·1 answer
  • Information systems include all of these
    5·1 answer
  • NEED HELP ASAP!!!!!!
    7·2 answers
  • ....is an act of introducing an invention into market on business basis for profit​
    12·1 answer
  • How was science used to make television?
    6·2 answers
  • The features used be of Computer that tell, it every field.​
    6·1 answer
  • Difference between hacking and cracking not hackers and crackers ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!