Save
Busy. Please wait.
Log in with Clever
or

show password
Forgot Password?

Don't have an account?  Sign up 
Sign up using Clever
or

Username is available taken
show password


Make sure to remember your password. If you forget it there is no way for StudyStack to send you a reset link. You would need to create a new account.
Your email address is only used to allow you to reset your password. See our Privacy Policy and Terms of Service.


Already a StudyStack user? Log In

Reset Password
Enter the associated with your account, and we'll email you a link to reset your password.
focusNode
Didn't know it?
click below
 
Knew it?
click below
Don't Know
Remaining cards (0)
Know
0:00
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.

  Normal Size     Small Size show me how

Comp. Sci. - Python

Quizzes 6 - 9

QuestionAnswer
State the 4 points of the while-loop checklist 1. Choose a variable to control the loop 2. Initialize that variable BEFORE the loop 3. Use that variable in the (Boolean) statement of the while-loop 4. Alter the value of the variable in the loop so that eventually the expression becomes fale
Define data coverage testing testing the program; test cases are chosen with all the data relevant to the program
Write a program fragment that uses a while-loop to compute the sum of the even integers from 200 through 400. Print the sum after it is completed. number = 200 total = 0 while number <= 400: total += number number += 2 print(total)
Show the exact output that this program would print on the screen if run. size = 32 while size > 3: print(size) size = size // 2 print(size) 32 16 8 4 2
Define data structure An aggregate of data that can be handled as a unit
How many bits does ASCII (or EBCDIC) use to represent each character? 8
How many bits does Unicode use to represent each character? (just fyi, not on a quiz or test that I know of...) 16 (also, ASCII, Unicode, and EBCDIC are called 'character sets')
Which of these character sets has the most characters: ASCII, EBCDIC, or Unicode? Unicode
Which of these character sets includes the Greek alphabet: ASCII, EBCDIC, or Unicode? Unicode
Given the variables below, show the value of the variable 'result' after each of these statements. fruit = strawberry index = 6 a. result = (fruit == "fruit") b. result = len(fruit) c. result = fruit[index - 1] d. result = fruit[-1] a. False b. 10 c. fruit[5] = 'b' d. 'y'
List the 3 points of the function checklist 1. What does it do (OR compute)? 2. What goes in? 3. What comes out?
Suppose a function called 'flag' requires three parameters called 'red', 'white', and 'blue'. Write the 'def' statement that appears at the beginning of this function. def flag(red, white, blue)
A developer writes a small main program to call the 'quizFunc' function repeatedly with carefully chosen test data as its arguments. Later, that function will be used with other functions in a completed application. What kind of testing is this? unit testing (that small main program used to call the function is called a 'driver')
After coding and testing several functions separately, the developer combines the functions and tests them together along with a main program. What kind of testing is this? integration testing
Write a complete function definition (including the 'def' statement and the body of the function) for a function that computes the area of a rectangle, given its length and width def area of rectangle (length, width): area = length * width return area
Write a statement to open a file for reading. The file variable is 'quizFile'. The physical file name is 'bisondata.txt'. quizFile = open("bisondata.txt", "r")
Let'outfilevar' be a file variable that is open for writing. Write a program fragment that writes 'Lipscomb' and then writes 'University' on the next line. outfilecar.write("Lipscomb\nUniversity")
Write the statement that enables your program to use any use any of the functions in the Math module. import math
Suppose you have a text file called 'lipscomb.txt' on your computer. Write a small program that opens 'lipscomb.txt', reads the entire file, and prints it on the screen. outputfile = open("lipscomb.txt", "r") for line in outputfile: print( line.strip() ) outputfile.close() OR (the following also works) outputfile = open("lipscomb.txt", "r") text = outputfile.read() print(text) outputfile.close
Created by: jjardor
Popular Computers sets

 

 



Voices

Use these flashcards to help memorize information. Look at the large card and try to recall what is on the other side. Then click the card to flip it. If you knew the answer, click the green Know box. Otherwise, click the red Don't know box.

When you've placed seven or more cards in the Don't know box, click "retry" to try those cards again.

If you've accidentally put the card in the wrong box, just click on the card to take it out of the box.

You can also use your keyboard to move the cards as follows:

If you are logged in to your account, this website will remember which cards you know and don't know so that they are in the same box the next time you log in.

When you need a break, try one of the other activities listed below the flashcards like Matching, Snowman, or Hungry Bug. Although it may feel like you're playing a game, your brain is still making more connections with the information to help you out.

To see how well you know the information, try the Quiz or Test activity.

Pass complete!
"Know" box contains:
Time elapsed:
Retries:
restart all cards