Computer Science > EXAM > CS 1101 Programming Fundamentals - Term 2, 2019-2020 | Review Quiz 30 Q&A (All)

CS 1101 Programming Fundamentals - Term 2, 2019-2020 | Review Quiz 30 Q&A

Document Content and Description Below

CS 1101 Programming Fundamentals - Term 2, 2019-2020 | Final Exam 30 Q&A Consider the following Python program. �n = open('words.txt') for line in �n: word = line.strip() print(word) ... What is line? Select one: a. A �le 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 Your answer is correct. The correct answer is: A string that may have a newline Question 2 Correct Mark 1.00 out of 1.00 Question 3 Correct Mark 1.00 out of 1.00 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 The correct answer is: 14 If you assign the result a void function to a variable in Python, you get: Select one: a. an empty string b. the value -1 c. the value 0 d. the special value None e. an exception Your answer is correct. The correct answer is: the special value None Question 4 Correct Mark 1.00 out of 1.00 Question 5 Correct Mark 1.00 out of 1.00 Consider the following Python program. �n = open('words.txt') for line in �n: word = line.strip() print(word) What does the program loop over? Select one: a. Lines in a �le b. Lines in a list c. Words in a dictionary d. Words in a list e. Words in a string [Show More]

Last updated: 4 months ago

Preview 3 out of 15 pages

Buy Now

Instant download

We Accept:

We Accept
loader

Loading document previews ...

Buy this document to get the full access instantly

Instant Download Access after purchase

Buy Now

Instant download

We Accept:

We Accept

Also available in bundle (1)

CS 1101 Programming Fundamentals. all terms questions and answers, practice questions with correct answers and project.

CS 1101 Programming Fundamentals. all terms questions and answers, practice questions with correct answers and project. the right A grade materials to pass.

By Professor Lynne 4 years ago

$11

13  

Reviews( 0 )

$10.00

Buy Now

We Accept:

We Accept

Instant download

Can't find what you want? Try our AI powered Search

115
0

Document information


Connected school, study & course


About the document


Uploaded On

Jun 07, 2021

Number of pages

15

Written in

Seller


seller-icon
Professor Lynne

Member since 4 years

370 Documents Sold

Reviews Received
34
13
4
0
4
Additional information

This document has been written for:

Uploaded

Jun 07, 2021

Downloads

 0

Views

 115

More From Professor Lynne

View all Professor Lynne's documents »

Recommended For You

Get more on EXAM »

$10.00
What is Scholarfriends

In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.

We are here to help

We're available through e-mail, Twitter, Facebook, and live chat.
 FAQ
 Questions? Leave a message!

Follow us on
 Twitter

Copyright © Scholarfriends · High quality services·