1 / 19

What is 13 DIV 3 where DIV is integer division?

This article covers topics such as integer division, modulus, Boolean logic, data types, lists, and functions in Python programming. It provides clear explanations and examples to help beginners understand these concepts.

caylor
Download Presentation

What is 13 DIV 3 where DIV is integer division?

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. What is 13 DIV 3 where DIV is integer division? • 2 • 3 • 4 • 5

  2. What is 13 MOD 3 where MOS is the modulus (remainder)? • 1 • 2 • 3 • 4

  3. If A=1 and B=3 then: A<B is false A<=B is true A>B is true A==B is true

  4. Which of these is true of the Boolean AND operator? • Returns true when a pair of expressions are true otherwise returns false • Returns true when either of a pair of expressions are true • Returns true when an expression is false, otherwise returns false. • Always returns false under all circumstances

  5. What data types would you use to represent your age?

  6. What data types would you use to represent a car registration number?

  7. What data types would you use to represent the height of a person?

  8. What is the value of c given the following? A=5 B=7 if A < B: print (“x”) elif A > B: print (“y”) else: print (“z”)

  9. What is the value of c given the following? a = 8 b = 7 c = a + b

  10. What sequence of numbers is output give the following? count = 2 while (count < 21): print(count) count = count + 4

  11. Given the following list what value is at index position month[2] (note index zero is the first element)? month=[“January", “April", “June", “August", “December”]

  12. Given the following list what index position is element “December”(note index zero is the first element)? month=[“January", “April", “June", “August", “December”]

  13. Given the following list what index position is element 5 at (note index zero is the first element)? a = [ [1, 2, 3],\ [4, 5, 6],\ [7, 8, 9]]

  14. Given the following list what value is at index position a[0][2] (note index zero is the first element)? a = [ [1, 2, 3],\ [4, 5, 6],\ [7, 8, 9]]

  15. How many parameters does the following function have? add(x,y): total=x+y returntotal

  16. Why is the following not a function? sqaure(x) x_sqaure=x*x

  17. What is a global variable? • A variable that can never be changed • Avariable that can be used anywhere in a program • Avariable that can only be accessed within a function • A variable that can never be accessed

  18. Given the code below what is output composer=“Beethoven” print(composer[2])

  19. C • A • B • A • C • A • B • A • B • A • D • D • A • C • B • A • B • B

More Related