Computer Science > ESSAY > CS 1101 Programming Fundamentals _Term 3_ CS 1101 - AY2019-T3 ► Final Exam (Days 1 - 4) ► Final  (All)

CS 1101 Programming Fundamentals _Term 3_ CS 1101 - AY2019-T3 ► Final Exam (Days 1 - 4) ► Final Exam. Score 30/30.

Document Content and Description Below

CS 1101 Programming Fundamentals Final Exam Home ► My courses ► CS 1101 - AY2019-T3 ► Final Exam (Days 1 - 4) ► Final Exam Question 1 Answer saved Marked out of 1.00 Question 2 Answer... saved Marked out of 1.00 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 lookup 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-2019 3/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 False 3/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. 13 3/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 3/28/2019 Final Exam https://my.uopeople.edu/mod/quiz/attempt.php?attempt=1772932&cmid=169617&page=1 1/4 Home ► My courses ► CS 1101 - AY2019-T3 ► Final Exam (Days 1 - 4) ► Final Exam Question 11 Not yet answered Marked out of 1.00 Question 12 Not yet answered Marked out of 1.00 Question 13 Not yet answered Marked out of 1.00 Which of the following types are allowed for Python dictionary keys? Select one: a. dictionary b. dictionary of lists c. list d. tuple e. All of the above What is the output of the following Python statements? def recurse(a): if (a == 0): print(a) else: recurse(a) recurse(0) Select one: a. 0 b. 1 c. no output d. RuntimeError: maximum recursion depth exceeded In most cases, it is possible to prevent an exception from terminating a program by using the try and except statements. Select one: True False CS 1101 Programming Fundamentals - Term 3, 2018-2019 3/28/2019 Final Exam https://my.uopeople.edu/mod/quiz/attempt.php?attempt=1772932&cmid=169617&page=1 2/4 Question 14 Not yet answered Marked out of 1.00 Question 15 Not yet answered Marked out of 1.00 Question 16 Not yet answered Marked out of 1.00 Question 17 Not yet answered Marked out of 1.00 Handling an exception with a try statement is called throwing an exception. Select one: True False In Python, once a variable has been created, its type cannot be changed in the program. Select one: True False The elements of a list are mutable. Select one: True False A Python expression is a combination of variables, operators, and values that represents a single result. Select one: True False 3/28/2019 Final Exam https://my.uopeople.edu/mod/quiz/attempt.php?attempt=1772932&cmid=169617&page=1 3/4 Question 18 Not yet answered Marked out of 1.00 Question 19 Not yet answered Marked out of 1.00 What output will the following Python script produce? def function2(param): print (param, param) def function1(part1, part2): cat = part1 + part2 function2(cat) chant1 = "See Me " chant2 = "See You " function1(chant1, chant2) Select one: a. See Me See You b. See You See Me See You See Me c. See Me See Me See You See You d. None it would generate an error Which of the following is not a Python keyword? Select one: a. def b. else c. in d. path e. break 3/28/2019 Final Exam Question 20 Not yet answered Marked out of 1.00 ◄ Review Quiz Jump to... What output will the following Python statement 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 3/28/2019 Final Exam Home ► My courses ► CS 1101 - AY2019-T3 ► Final Exam (Days 1 - 4) ► Final Exam Question 21 Not yet answered Marked out of 1.00 Question 22 Not yet answered Marked out of 1.00 The invert_dict Python function is supposed to invert a dictionary. Based on the sample input and the output shown below, the function is correct. invert_dict({1: 10, 2: 10, 3: 20}) {10: [1, 2, 3], 20: [3]} Select one: True False What does Python function procedure do? def procedure( n ): while n > 0: print (n,) n = n - 1 Select one: a. Counts from 10 down to 0 and displays each number b. Counts from n down to 1 and displays each number c. Calculates the sum of n numbers greater than 0 d. Calculates the mean of n CS 1101 Programming Fundamentals - Term 3, 2018-2019 3/28/2019 Final Exam Question 23 Not yet answered Marked out of 1.00 Question 24 Not yet answered Marked out of 1.00 Functions like print which perform an action but don’t return a value are called: Select one: a. recursive functions b. built-in functions c. simple functions d. utility functions e. void functions The Python code below is an example of recursion: def fa(): fb() def fb(): fa() fa() Select one: True False 3/28/2019 Final Exam Question 25 Not yet answered Marked out of 1.00 Question 26 Not yet answered Marked out of 1.00 Question 27 Not yet answered Marked out of 1.00 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 What is the value of the following Python expression? not(True or False) Select one: True False An error in a program that makes it do something other than what the programmer intended is called: Select one: a. a syntax error b. a semantic error c. an exception d. a user error e. a side-eàect 3/28/2019 Final Exam Question 28 Not yet answered Marked out of 1.00 Question 29 Not yet answered Marked out of 1.00 Question 30 Not yet answered Marked out of 1.00 ◄ Review Quiz Jump to... The Python line below causes “5 dollars” to be printed. print('%s %d' % (5, 'dollars')) Select one: True False If a Python function modiÕes an argument of type list, the caller’s corresponding variable is modiÕed to match. Select one: True False What is the output of the following Python script? pi = Öoat(3.14159) print (pi) Select one: a. 3 b. 3.0 c. 3.14159 d. 0 [Show More]

Last updated: 1 year ago

Preview 1 out of 12 pages

Reviews( 0 )

Recommended For You

 Biology> ESSAY > The Dangers of Aspergillus flavus in Common Foods (All)

preview
The Dangers of Aspergillus flavus in Common Foods

• Fungi in the ecosystem o A specific fungus or group of fungi used in bioremediation or recycling o A specific kind or a type of mycorrhizal fungi o A specific fungus or group of fungi causing a d...

By Augustine , Uploaded: Oct 29, 2020

$7

 Sociology> ESSAY > Critical Perspectives on the Population Debate (All)

preview
Critical Perspectives on the Population Debate

Issues of sustainability have been the topic of civil, popular and academic discourse for centuries. The debates in this area of discourse reflect a range of underlying perspectives and worldviews. Fo...

By Augustine , Uploaded: Oct 29, 2020

$5

 Business Law> ESSAY > BUSI F018 07W Business Law Paper 1- History of a Legal Organization (All)

preview
BUSI F018 07W Business Law Paper 1- History of a Legal Organization

History of a Legal Organization The purpose of this paper is to explore the micro impacts and purpose behind a major legal organization impacting businesses today. When organizations are put into pla...

By Kirsch , Uploaded: Oct 17, 2019

$7

 Business Law> ESSAY > BUSI F018 07W Business Law. Assignment 3 - Breach of Contract. Graded A (All)

preview
BUSI F018 07W Business Law. Assignment 3 - Breach of Contract. Graded A

Research one of the following cases: (Use a google search to find plenty of information on the case) 1. Revelations Perfume and Cosmetics Inc. v. Prince Rogers Nelson 2. Macy’s v. Martha Stewart...

By Kirsch , Uploaded: Oct 17, 2019

$6

 Health Care> ESSAY > HSA 501 Week 8 Assignment 2: Managing Health Care Quality (worth 200 points) (All)

preview
HSA 501 Week 8 Assignment 2: Managing Health Care Quality (worth 200 points)

HSA 501 Week 8 Assignment 2 Assignment 2: Managing Health Care Quality Due Week 8 and worth 200 points Imagine that you are a hospital administrator at the Sunlight Hospital in California. The main co...

By RayJewell , Uploaded: Sep 27, 2021

$5

 Business Administration> ESSAY > BUS 309 Assignment 3, Not All Companies Are Viewed as Equal. Complete Solution Guide; Strayer University. (All)

preview
BUS 309 Assignment 3, Not All Companies Are Viewed as Equal. Complete Solution Guide; Strayer University.

Assignment 3: not all companies are viewed as equal Assignment 3: Not All Companies Are Viewed as Equal Final submission is due in Week 6 and worth 125 points (This is your rough draft) In the la...

By Expert1 , Uploaded: Jun 08, 2020

$9

 *NURSING> ESSAY > NR 506NP Week 3 / NR506NP Quality Healthcare: Measuring Nurse Practitioner Performance. Chapter 3Paper_ (All)

preview
NR 506NP Week 3 / NR506NP Quality Healthcare: Measuring Nurse Practitioner Performance. Chapter 3Paper_

NR506NP Week 3 Paper_ Quality Healthcare: Measuring Nurse Practitioner Performance Chamberlain College of Nursing Professor Candice Phillips NR506NP: Healthcare Leadership and Policy S...

By Bestanalytic , Uploaded: Feb 15, 2021

$10

 Business> ESSAY > BUSINESS ENGL120 Case Study FINAL University of the West Indies at Mona (All)

preview
BUSINESS ENGL120 Case Study FINAL University of the West Indies at Mona

BUSINESS ENGL120 Case Study FINAL 1. Introduction Abstract This case study seeks to identify the strategies that Dr. Pepper Snapple, a beverage company, can undertake in order to improve their c...

By QuizMaster , Uploaded: Sep 19, 2020

$11

 *NURSING> ESSAY > NR 661 REFLECTION ON THE DOCTOR OF NURSING PRACTICE (DNP) (All)

preview
NR 661 REFLECTION ON THE DOCTOR OF NURSING PRACTICE (DNP)

NR 661 REFLECTION ON THE DOCTOR OF NURSING PRACTICE (DNP)

By Quality Suppliers , Uploaded: Jan 31, 2021

$12

 Art> ESSAY > HUM 111 Assignment 1 Strayer University | The Mystery of the Tomb of Shi Huangdi (All)

preview
HUM 111 Assignment 1 Strayer University | The Mystery of the Tomb of Shi Huangdi

HUM 111 Assignment 1 2020 - Strayer University Essy The Mystery of the Tomb of Shi Huangdi The Mystery The mystery of the tomb of the First Emperor of China, who died in 210 BC, is not only beca...

By Martin Freeman , Uploaded: Dec 27, 2020

$8

$8.50

Add to cart

Instant download

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

OR

GET ASSIGNMENT HELP
328
2

Document information


Connected school, study & course



About the document


Uploaded On

Dec 01, 2020

Number of pages

12

Written in

Seller


seller-icon
QuizMaster

Member since 4 years

1085 Documents Sold


Additional information

This document has been written for:

Uploaded

Dec 01, 2020

Downloads

 2

Views

 328

Document Keyword Tags

THE BEST STUDY GUIDES

Avoid resits and achieve higher grades with the best study guides, textbook notes, and class notes written by your fellow students

custom preview

Avoid examination resits

Your fellow students know the appropriate material to use to deliver high quality content. With this great service and assistance from fellow students, you can become well prepared and avoid having to resits exams.

custom preview

Get the best grades

Your fellow student knows the best materials to research on and use. This guarantee you the best grades in your examination. Your fellow students use high quality materials, textbooks and notes to ensure high quality

custom preview

Earn from your notes

Get paid by selling your notes and study materials to other students. Earn alot of cash and help other students in study by providing them with appropriate and high quality study materials.

WHAT STUDENTS SAY ABOUT US


What is Browsegrades

In Browsegrades, 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 © Browsegrades · High quality services·