100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COSC 1306 - SET 3: Exam Review questions well answered to pass

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
13-12-2024
Written in
2024/2025

COSC 1306 - SET 3: Exam Review questions well answered to pass

Institution
Cosc
Course
Cosc









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Cosc
Course
Cosc

Document information

Uploaded on
December 13, 2024
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COSC 1306 - SET 3: Exam Review
questions well answered to pass

What is the output of print?



print('%0.5.1f' % 75.55) - correct answer ✔✔075.5



Write a function call using print_sum() to print the sum of x and 400 (prividing the arguments in that
order). - correct answer ✔✔print_sum(x, 400)



Write a statement that assigns str2 with a copy of str1. - correct answer ✔✔str2 = str1[:]

no spaces between the colon



The statement return a, b, c [c, d] is valid. - correct answer ✔✔True



PV = nRT. Compute the temperature of a gas.



Function convert_to_pres() would likely return (temp * volume) / (mols * gas_constant). - correct answer
✔✔False



Add a return statement to the function that returns the cube of the argument, i.e. (num*num*num).



def cubed(num): - correct answer ✔✔return (num * num * num)



Complete the function definition requiring two arguments arg1 and arg2, and an arbitrary argument list
args.



def f( __blank__):

, # . . . - correct answer ✔✔arg1, arg2, *args



A program can modify the elements of an existing list. - correct answer ✔✔True



What is the output of print?



print('%05d' % 150) - correct answer ✔✔00150



A local variable's scope extends from a function definition's ending colon ":" to the end of the function. -
correct answer ✔✔True



Given the list nums = [[10, 20, 30], [98, 99]], what does nums[0][0] evaluate to? - correct answer ✔✔10



nums[0] returns the list [10, 20, 30]. The 1st element of the list nums[0][0], is 10



Copying and pasting code can lead to common errors if all necessary changes are not made to the pasted
code. - correct answer ✔✔True



Which correctly defines two parameters x and y for a function definition:

def calc_val(. . .):? - correct answer ✔✔(x, y)



Incremental developing may involve more frequent testing, but ultimately leads to faster developing of a
program. - correct answer ✔✔True



Is the following statement invalid?



y = square_root() - correct answer ✔✔False



Given a function definition:

def calc_val(a, b, c): and given variables i, j, k,

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
BravelRadon Havard School
View profile
Follow You need to be logged in order to follow users or courses
Sold
873
Member since
4 year
Number of followers
540
Documents
41495
Last sold
4 days ago
EXAM HUB

Welcome to Exam Hub Are you looking for high-quality, exam-ready notes, past papers, Test Banks, and well-researched study materials to boost your grades? You’re in the right place! I create and upload detailed, easy-to-understand, and well-structured documents across multiple subjects. All my materials are designed to help you study , save time, and excel in your coursework and exams! On this page NURSING EXAMS,STUDY GUIDES,TESTBANKS AND QUALITY EXAMS IS THE KEY TO STUDENTS CAREER EXCELLENCE, you find all documents, package deals, and flashcards offered by BravelRadon (EXAM HUB STORES!)....kindly recommend a friend for A+ GARANTEEd either you are a first-year student or final-year graduation! best of luck!

Read more Read less
3.5

154 reviews

5
56
4
30
3
32
2
8
1
28

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions