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

CS1101 - Unit 5 Questions With 100% Correct!!

Rating
-
Sold
-
Pages
3
Grade
A+
Uploaded on
07-05-2024
Written in
2023/2024

What does function subroutine do? def subroutine( n ): while n > 0: print (n,) n -= 1 - Answer-Counts from n down to 1 and displays each number What output will the following python command produce: >>> percentage = float ( 60 * 100) / 55 >>> print (percentage) - Answer-109. What output will the following python commands produce: n = 10000 count = 0 while n: count = count + 1 n = n // 10 print (count) - Answer-5 What output will the following python commands produce: x = 5 if x % 2 == 0: print (x)else: print (x, x%2) - Answer-5 1 What does function subroutine do? def subroutine(n): while n > 0: print (n,) n -= 1 - Answer-Counts from n down to 1 and displays each number What is the output of the following statements? pi = float(3.14159) print (pi) - Answer-3.14159 What is the output of the following statements? pi = int(3.14159) print (pi) - Answer-3 Expressions evaluate to either true or false. What will the output of the following code be when the expression "Ni!" is evaluated? if "Ni!": print ('We are the Knights who say, "Ni!"') else: print ("Stop it! No more of this!") - Answer-We are the Knights who say, "Ni!" 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) - Answer-1 is less than 2 The following code is an example of what principle? bruce = 5 print (bruce,) bruce = 7 print (bruce) - Answer-Multiple assignment True/False: The % or modulus operator returns the remainder present when two integers do not divide evenly into one another - Answer-True True/False: An algorithm is a step by step process for solving a problem. - Answer-True Functions allow the programmer to encapsulate and generalize sections of code. - Answer-True One way to generalize a function is to replace a variable with a value. - Answer-False A variable name defined in a function cannot appear in the calling program because it will cause a conflict error. - Answer-False

Show more Read less
Institution
CS1101 - Unit 5
Course
CS1101 - Unit 5








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

Written for

Institution
CS1101 - Unit 5
Course
CS1101 - Unit 5

Document information

Uploaded on
May 7, 2024
Number of pages
3
Written in
2023/2024
Type
Exam (elaborations)
Contains
Questions & answers

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.
Brainarium Delaware State University
View profile
Follow You need to be logged in order to follow users or courses
Sold
1825
Member since
2 year
Number of followers
1043
Documents
22338
Last sold
2 days ago

3.8

317 reviews

5
147
4
60
3
54
2
16
1
40

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