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

Python Ch. 1 Review

Review of Python Chapter 1

QuestionAnswer
1. Which mathematical operator is used to raise a number to a power (exponent) in Python? **
2. What data type is the variable "amount" assigned? amount = 430.87 A float data type
3. What data type AND value is the variable "total" assigned? total = int(98.5) An int data type. Value is 98.
4. How can you print a string that prints data on multiple lines? using triple quotes or by using "\n" inside the string.
5. What will this statement do? print ("I'm ready to read "Harry Potter" ") Result in a Syntax Error, due to the double quotes inside the literal and the double quotes used to enclose it
6. What will this statement do? print ('I'm ready to read "Harry Potter" ') Result in a Syntax Error, due to the single quote (apostrophe) inside the literal and the single quotes used to enclose it
7. What will this statement do? print( """I'm ready to read "Harry Potter" """) It will print the string literal with NO errors due to the triple quotes enclosure.
8. If x=10, which print statement will NOT produce a syntax error? a. print ('I have' x 'pairs of shoes') b. print('I have,' x ', pairs of shoes) c. print ('I have', x, 'pairs of shoes') d. none of the above! c. print ('I have', x, 'pairs of shoes') (you need to separate the items with commas!)
9. What character starts a comment in Python? #
10. What value and data type will the variable x be assigned? x = 11/2 5.5 which is a 'float' (in Python, the / divides full division)
11. What value and data type will the variable y reference? y = 11//2 5 which is an 'int' (in Python, the // does integer division and throws away the decimal part)
12. What is the result of the following expression in Python? 3+4**2-1 18
13. What is the output of this statement? print (19 % 5) 4 (19 divided by 5 is 3 remainder 4)
14. String literals are encolsed with: a. single quotes '' b. double quotes "" c. parenthesis () d. single or double quotes d. single or double quotes (as long as you use the same one in the beginning and the end!)
15. Which one(s) will give an error? a. x1 = 100 b. 1x = 100 c. room# = 209 d. room number = 209 b, c, and d
16. What will this print? x = 5 y = 3.5 print (x + y) 8.5 (float data type)
17. What will this print? x = 7 y = 2 print (x/y) 3.5 (float data type)
18. What will this print? x = "10" y = "5" print (x + y) "105" (string data type)
19. Which function allows the user to enter information from the keyboard? input()
20. What data type is assigned to x? x = input("please enter a number") x will be a string!
21. What is the format (syntax) of the input function? variable = function (question). Example: name = input("What is your name? ")
22. What will this print? print( (6-3) * 2 + 7 / 2) 9.5
Created by: klaidley
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