1 / 27

CS 1301

CS 1301. Jeopardy. Hosted by Jay. © Don Link, Indian Creek School, 2004. Robot . True?. Programs. Data Types. Potpourri. $200. $200. $200. $200. $200. $400. $400. $400. $400. $400. $600. $600. $600. $600. $600. $800. $800. $800. $800. $800. $1000. $1000. $1000.

awena
Download Presentation

CS 1301

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 1301 Jeopardy Hosted by Jay © Don Link, Indian Creek School, 2004

  2. Robot True? Programs Data Types Potpourri $200 $200 $200 $200 $200 $400 $400 $400 $400 $400 $600 $600 $600 $600 $600 $800 $800 $800 $800 $800 $1000 $1000 $1000 $1000 $1000

  3. This myro function returns 0 or 1 value(s) ‏based upon obstacles behind the robot. Robot for $200 getIR()‏

  4. Motors(-1,1) causes the robot to do this. Spin counter- clockwise (left). Robot for $400

  5. Range of possible values returned by the getObstacle() function. 0 to 7000 Robot for $600

  6. The dimensions of the picture returned by the takePicture() function. Robot for $800 256 (X) by 192 (Y)‏

  7. Difference between the getLight() and getBright() functions. Robot for $1000 getLight() returns values from sensors on robot, getBright() returns sum of pixel values from fluke camera.

  8. What is the values of: ( (14 >= 0) or (4 != 3) ) True? for $200 True

  9. All recursive functions have these 2 parts: a base (terminating) case, and a recursive call. True? for $400 False

  10. getIR(“left”) and (5 % 2 == 3) True? for $600 False

  11. for i in range(5,3,-1): if (i % 2 == 0): return True else: return False False True? for $800

  12. ( (5 > 4) or (10 >= 10) ) or (not (5 / 4 == 1)) True True? for $1000

  13. What this program prints: for i in range(10): print i + 1 Numbers 1 through 10, one per line. Programs for $200

  14. x = 5 while (x > 0): print x x = x-1 Programs for $400 Numbers 5 to 1, one per line

  15. Write this using a while loop: for i in range(5,10,2): print i Programs for $600 x = 5 while ( x < 10): print x x = x+2

  16. Result of mystery(2,3): def mystery(a,b): if (a == 0): return b else: return mystery(a-1, b+1)‏ 5 Programs for $800

  17. What the mystery function does: def mystery(a,b): if (a == 0): return b else: return mystery(a-1, b+1)‏ Programs for $1000 Sum a and b.

  18. Five immutable data types. Data types for $200 int, float, string, bool, tuple

  19. myList = [True,34, [5,6],”test”] An expression that accesses the number six (6) from the list(s) above. Data types for $400 myList[2][1]

  20. How to change myStr = “Jay” To myStr = “jay” Data types for $600 myStr = ‘j’ + myStr[1:]

  21. A = [5,6,7,8] B = A B[3] = B[2]+3 The value of A[3] 10 Data types for $800

  22. r = “Python is Great!” The result of: r[2]+r[12]+r[8]+r[14]+r[15] Data types for $1000 test!

  23. This return value means that a function did not return a specific value. Potpourri for $200 None, (of type NoneType)

  24. These are the three types of sensors on the Lancet Fluke. Potpourri for $400 IR Obstacle sensors (getObstacle), the camera (takePicture, getBright), and the battery voltage (getBattery) sensor.

  25. Arithmetic operators (like +, -, *, /) have _____ precedence than logical operators (like or, and, not) so arithmetic is done _____. Potpourri for $600 Higher/greater, first

  26. Rewrite the following code using a for loop. x = 7 while (x > 3): print x x = x -1 for x in range(7,3,-1): print x Potpourri for $800

  27. This is the sorting algorithm that Donald Knuth credits John von Neumann with inventing. Potpourri for $1000 Merge Sort

More Related