Question

Not yet answered Marked out of 1.00 Flag question Question text What is the value of...

Not yet answered Marked out of 1.00 Flag question Question text What is the value of the following Python expression? not(True and False) Select one: True False Question 2 Not yet answered Marked out of 1.00 Flag question Question text Consider the following Python program. fin = open('words.txt') for line in fin: word = line.strip() print(word) What does the program loop over? Select one: a. Lines in a file b. Lines in a list c. Words in a dictionary d. Words in a list e. Words in a string Question 3 Not yet answered Marked out of 1.00 Flag question Question text What output will the following code produce? mylist = [ [2,4,1], [1,2,3], [2,3,5] ] a=0 b=0 total = 0 while a <= 2: while b < 2: total += mylist[a][b] b += 1 a += 1 b = 0 print (total) Select one: a. 14 b. 23 c. 0 d. 13 Question 4 Not yet answered Marked out of 1.00 Flag question Question text What output will the following code produce? def area(l, w): temp = l * w; return temp l = 4.0 w = 3.25 x = area(l, w) if ( x ): print (x) Select one: a. 13.0 b. 0 c. Expression does not evaluate to boolean true d. 13 Question 5 Not yet answered Marked out of 1.00 Flag question Question text What output will the following code produce? print ("%s %d %f" % (5, 5, 5)) Select one: a. 5 5 5.000000 b. 5 5 5 c. 5 5.000000 d. 0 5 5.0 Question 6 Not yet answered Marked out of 1.00 Flag question Question text Consider the following Python program. fin = open('words.txt') for line in fin: word = line.strip() print(word) What is word? Select one: a. A file object b. A list of characters c. A list of words d. A string that may have a newline e. A string with no newline Question 7 Not yet answered Marked out of 1.00 Flag question Question text The Python expression 'Unit 6'[-1] has value '6'. Select one: True False Question 8 Not yet answered Marked out of 1.00 Flag question Question text What is Python’s response to the command: type(0.123) Select one: a. b. c. SyntaxError: invalid syntax d. e. Question 9 Not yet answered Marked out of 1.00 Flag question Question text Consider the following Python program. fin = open('words.txt') for line in fin: word = line.strip() print(word) What is line? Select one: a. A file object b. A list of characters c. A list of words d. A string that may have a newline e. A string with no newline Question 10 Not yet answered Marked out of 1.00 Flag question Question text Which of the following types are allowed for Python dictionary values? Select one: a. dictionary b. list c. list of dictionaries d. tuple e. all of the above Question 11 Not yet answered Marked out of 1.00 Flag question Question text What output will the following code produce? n = 10 while n != 1: print (n,end=' ') if n % 2 == 0: # n is even n = n // 2 else: # n is odd n = n * 3 + 1 Select one: a. 10 5 16 8 4 2 b. None an error will be displayed c. 8 4 2 d. 9 28 14 7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 Question 12 Not yet answered Marked out of 1.00 Flag question Question text What output will the following python commands produce: x=1 y=2 if x == y: print (x, "and", y, "are equal") else: if x < y: print (x, "is less than", y) else: print (x, "is greater than", y) Select one: a. 1 and 2 are equal b. 1 is less than 2 c. 1 is greater than 2 d. 2 is greater than 1

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Dear Student ,

As per the requirement submitted above , kindly find the below solution.

Question 1:

Answer :True

Explanation :Here expression not(True and False) , returns False and not(False) means true and hence the answer.

*******************************

Question 2:

Answer :a. Lines in a file

Explanation :Loop will over when lines in the files read one by one.

*******************************

Question 3:

Answer :a. 14

Explanation :Below screen shows the output

*******************************

Question 4:

Answer :a. 13.0

Explanation :Below screen shows the output.

*******************************

Question 5:

Answer : a. 5 5 5.000000

Explanation :Given statement print %s is string literal , %d is place holder for numeric or decimal value and %f is floating point.Below screen shows the output.

*******************************

Question 6:

Answer :c. A list of words

Explanation :Here words contains the list of words from the line.

*******************************

Question 7:

Answer :True

Explanation :Below screen shows the output

*******************************

Question 11:

Answer :a. 10 5 16 8 4 2

Explanation :Below screen shows the output

*******************************

Question 12:

Answer :b. 1 is less than 2

Explanation :In the given code snippet 1 is less then 2 and hence will produce output as given above.Below screen shows the output.

*******************************

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.

Add a comment
Know the answer?
Add Answer to:
Not yet answered Marked out of 1.00 Flag question Question text What is the value of...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 1 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text The statements...

    Question 1 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text The statements inside of a Python loop are known as the ____ of the loop. Select one: a. body b. expression c. counter d. block Question 2 Not yet answered Marked out of 1.00 Not flaggedFlag question Question text The Python 3 program below prints the number 3. s = "Python3" print(s[len(s)]) Select one: True False Question 3 Not yet answered Marked out of 1.00 Not...

  • Question 1 Not yet answered Marked out of 1.00 Flag question Question text SQL is a...

    Question 1 Not yet answered Marked out of 1.00 Flag question Question text SQL is a programming language for web-site development. Select one: a. TRUE b. FALSE Question 2 Not yet answered Marked out of 1.00 Flag question Question text Moral dimensions of the information age do NOT include _____. Select one: a. Information rights and obligations b. Accountability and control. c. Information safety d. Property rights and obligations Question 3 Not yet answered Marked out of 1.00 Flag question...

  • Question 1 Not yet answered Marked out of 1.00 Flag question Question text Which of the...

    Question 1 Not yet answered Marked out of 1.00 Flag question Question text Which of the following keywords is useful for skipping to the next iteration of a loop? Select one: a. do b. break c. switch d. continue e. while Clear my choice Question 2 Not yet answered Marked out of 1.00 Flag question Question text Consider the following line of Java code. System.out.println("Hello, World!"); "out" is which of the following? Select one: a. a statement b. a class...

  • Question 29 Not yet answered Marked out of 1.00 P Flag question What is the role...

    Question 29 Not yet answered Marked out of 1.00 P Flag question What is the role of substrate-level phosphorylation in glycolysis? Select one: a. a process to synthesize oxygen (02) b. a process to do all of the above (a, b and c) c. a process to synthesize glucose d. a process used to synthesize ATP Question 35 Not yet answered Marked out of 1.00 P Flag question Plants use_to transport sucrose to all regions of the organism. Select one:...

  • Question 1 Not yet answered Marked out of 1.00 p Flag question Which of the following...

    Question 1 Not yet answered Marked out of 1.00 p Flag question Which of the following is result of decisions based on inaccurate information? Select one: a. Delivering products to customers on time O b. Meeting customers' demands O c. All the answers d. Misallocation of resources Question 2 Not yet answered Marked out of 1.00 p Flag qu In digital firms, Core business processes are accomplished digitally Select one: a. True о b. FALSE Previous page f Question 7...

  • Question 11 Not yet answered Marked out of 1.00 P Flag question The DNA of an...

    Question 11 Not yet answered Marked out of 1.00 P Flag question The DNA of an organism is studied and found to contain 14% guanine. This organism should have __% thymine and __% cytosine in its DNA. Select one: O a. 36; 36 O b. 14; 36 O c. 14; 86 O d. 36; 14 Question 12 Not yet answered Marked out of 1.00 Flag question The strands of a DNA double helix are said to be antiparallel. This means...

  • Not yet answered Graded out of 1.00 Flag question Question text In the process of photosynthesis,...

    Not yet answered Graded out of 1.00 Flag question Question text In the process of photosynthesis, water and carbon dioxide are produced. Select one: True False Question 2 Not yet answered Graded out of 1.00 Flag question Question text In the carbon cycle, combustion produces atmospheric oxygen. Select one: True False Question 3 Not yet answered Graded out of 1.00 Flag question Question text In a balanced chemical equation, the number of each type of atom in the reactants must...

  • Question 4 The pH is defined as Not yet answered Marked out of 1.00 P Flag...

    Question 4 The pH is defined as Not yet answered Marked out of 1.00 P Flag question Select one: 0 -log[H] o 10[++] O 10-[H+] O log[H+] Question 5 If the pol of a solution is 4, what is its pH? Not yet answered Marked out of 1.00 Select one: o 7 O 10 p Flag question

  • Question 79 Not yet answered Marked out of 1.00 P Flag question Evolutionary fitness refers to...

    Question 79 Not yet answered Marked out of 1.00 P Flag question Evolutionary fitness refers to Select one: O a. size o b. strength O c. potential reproductive success O d. longevity Not yet answered Marked out of 1.00 p Flag question Evolutionary fitness refers to

  • Question 1 Not yet answered Marked out of 1.00 P Flag question In a New Zealand...

    Question 1 Not yet answered Marked out of 1.00 P Flag question In a New Zealand snail species, both sexual and asexual populations can be found in the same geographic region. Which hypothesis best explained why this occurs? Select one: a, environmental unpredictability hypothesis b. red queen hypothesis c. multiple niche hypothesis d. All of the above Question 9 Not yet answered Marked out of 1.00 P Flag question Because eggs take more energy investment and are more rare compared...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT