subject
Computers and Technology, 18.08.2020 14:01 mat1413

The following program is supposed to display a message indicating if the integer entered by the user is even or odd. What is wrong 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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 09:00
Design a class tictactoe that: holds the following information about the game: two-dimensional array (3 by 3), and winner. add additional variables as needed. includes the functions to perform the various operations on objects. for example, function to print the board, getting the move, checking if move is valid, determining if there is a winner after each move. add additional operations as needed. includes constructor(s). write the functions of the class, and write a program that uses the class. the program should declare an object of type tictactoe. the program will create the board and store it in the array. the program will allow two players to play the tic-tac-toe game. after every valid move update the array, check if there is a winner. if there is no winner and no tie, then print the board again to continue.
Answers: 2
question
Computers and Technology, 23.06.2019 20:00
How much current flows through the alternator brushes? a. 2–5 a b. 25–35 a, depending on the vehicle c. 5–10 a d. 10–15 a
Answers: 2
question
Computers and Technology, 23.06.2019 23:00
Lucas put a lot of thought into the design for his company's new white paper. he made sure to include repeating design elements such as color schemes and decorative images. his goal was to a.add symmetry b.create a unified publication c.provide consistency d.save money
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Auniform resource locator (url) is a formatted string of text that web browsers, email applications, and other software programs use to identify a particular resource on the internet. true false
Answers: 2
You know the right answer?
The following program is supposed to display a message indicating if the integer entered by the user...
Questions
question
Mathematics, 04.06.2021 20:50
question
Social Studies, 04.06.2021 20:50
question
Mathematics, 04.06.2021 20:50
question
Mathematics, 04.06.2021 20:50
Questions on the website: 13722363