Menu

[Solved]Question 9 Co 6 Best Way Call Main Function Program Code Main Statement Calls Main Functio Q37200392

Question 9

(CO 6) The best way to call the main() function of a program isto code

main()

a while statement that calls the main() function in eachloop

an if statement that calls the main() function in eachmethod

an if statement that calls the main() function only if thecurrent module is the main module

Question 10

(CO 6) A variable that can only be used within the function thatdefines it is known as a ______

local variable

global variable

shadow variable

unknown variable

Question 11

(CO 6) Which of the following statements imports a module?

export temperature

import temperature

from temperature import

global temperature import

Question 12

(CO 5) To insert the item “chewie” after “solo” in the followinglist, which of the following methods would you use?

falcon = [“han”, “leia”, “solo”, “yoda”, “luke”]

falcon.pop(3,”chewie”)

falcon.remove(3,”chewie”)

falcon.insert(3,”chewie”)

falcon.insert(“chewie”, 3)

Question 13

(CO 5) The ______________ method adds an item to the end of alist.

index()

insert()

pop()

append()

Question 14

(CO 5) Given the following list, what is the value ofnames[5]?
names = [“Harry”, “Ron”, “Ginny”, “Draco”, “Rowena” ]

“Harry”

“Rowena”

“Ron”

None – index error

Question 15

(CO 5) What is the value of the total variable after thefollowing code executes?

prices=[66, 22, 47, 30]
total = 0
i=1
while i<len(prices):
    total+=prices[i]
    i+=1
print(total)

35

66

0

99

Expert Answer


Answer to Question 9 (CO 6) The best way to call the main() function of a program is to code main() a while statement that calls t… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *