Busy. Please wait.
or

show password
Forgot Password?

Don't have an account?  Sign up 
or

Username is available taken
show password

why


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.
We do not share your email address with others. It is only used to allow you to reset your password. For details read 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.

Remove Ads
Don't know
Know
remaining cards
Save
0:01
To flip the current card, click it or press the Spacebar key.  To move the current card to one of the three colored boxes, click on the box.  You may also press the UP ARROW key to move the card to the "Know" box, the DOWN ARROW key to move the card to the "Don't know" box, or the RIGHT ARROW key to move the card to the Remaining box.  You may also click on the card displayed in any of the three boxes to bring that card back to the center.

Pass complete!

"Know" box contains:
Time elapsed:
Retries:
restart all cards




share
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