Computer Science > EXAM > CS 1101 Programming Fundamentals - Term 3, 2018-2019 (All)

CS 1101 Programming Fundamentals - Term 3, 2018-2019

Document Content and Description Below

Assume that d is a Python dictionary. What does the following Python code produce? d.items() Select one: a. a histogram b. an inverted dictionary c. a list of tuples d. a lookup e. a reverse l... ookup What output will the following code produce? n = 10 while n != 1: print (n,) 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 CS 1101 Programming Fundamentals - Term 3, 2018-20193/28/2019 Final Exam https://my.uopeople.edu/mod/quiz/attempt.php?attempt=1772932&cmid=169617 2/4 Question 3 Answer saved Marked out of 1.00 Question 4 Answer saved Marked out of 1.00 What output will the following Python commands produce? n = 1000 count = 0 while n: count = count + 1 n = n // 10 print (count) Select one: a. 0 b. 4 c. 5 d. 1000 e. 10000 This Python code: for fruit in ["banana", "apple", "quince"]: print (fruit) will produce this output: banana apple quince Select one: True False3/28/2019 Final Exam https://my.uopeople.edu/mod/quiz/attempt.php?attempt=1772932&cmid=169617 3/4 Question 5 Answer saved Marked out of 1.00 Question 6 Answer saved Marked out of 1.00 Question 7 Answer saved Marked out of 1.00 What is the output of the following Python program? index = "Ability is a poor man's wealth".Õnd("w") print(index) Select one: a. 24 b. 0 c. 23 d. -1 Given a Python dictionary d and a value v, it is eÞcient to Õnd the corresponding key: d[k] = v. Select one: True False 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. 133/28/2019 Final Exam https://my.uopeople.edu/mod/quiz/attempt.php?attempt=1772932&cmid=169617 4/4 Question 8 Answer saved Marked out of 1.00 Question 9 Answer saved Marked out of 1.00 Question 10 Answer saved Marked out of 1.00 ◄ Review Quiz Jump to... Python tuples are mutable. Select one: True False Generally speaking, Õlter list operations produce a diàerent number of list elements compared to map operations. Select one: True False In Python, a list of characters is the same as a string. Select one: True False [Show More]

Last updated: 2 years ago

Preview 1 out of 12 pages

Buy Now

Instant download

We Accept:

We Accept
document-preview

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)

computer programming questions and answers

exam questions and correct answers

By Prof.Pierro 4 years ago

$13

12  

Reviews( 0 )

$8.00

Buy Now

We Accept:

We Accept

Instant download

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

120
0

Document information


Connected school, study & course


About the document


Uploaded On

Jun 11, 2021

Number of pages

12

Written in

Seller


seller-icon
Prof.Pierro

Member since 4 years

255 Documents Sold

Reviews Received
31
7
3
0
0
Additional information

This document has been written for:

Uploaded

Jun 11, 2021

Downloads

 0

Views

 120

Document Keyword Tags

Recommended For You

Get more on EXAM »

$8.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·