Skip to content

Practice: Basic Data Types

Julia Ogris edited this page Aug 18, 2023 · 3 revisions

Q1.1

What is the type of 2?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution C

Q1.2

What is the type of -2.3?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution C

Q1.3

What is the type of 0?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution C

Q1.4

What is the type of true?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution B

Q1.5

What is the type of false?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution B

Q2.1

What is the type of "abc"?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution A

Q2.2

What is the type of "Howdie!"?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution A

Q3.1

What is the type of "1"?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution A

Q3.2

What is the type of "-3.1"?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution A

Q3.3

What is the type of "true"?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution A

Q3.4

What is the type of "false"?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution A

Q4.1

What does this program output?

print 1 2 12

Choose one correct answer:

  • A:

    1212
    
  • B:

    1 2 12
    
  • C:

    print 1 2 12
    
  • E: program errors

  • F: none of the above

Solution B

Q4.2

What does this program output?

print false true

Choose one correct answer:

  • A:

    false true
    
  • B:

    false
    true
    
  • C:

    print false true
    
  • E: program errors

  • F: none of the above

Solution A

Q5.1

What does this program output?

print false "true"

Choose one correct answer:

  • A:

    false true
    
  • B:

    false "true"
    
  • C:

    print false "true"
    
  • E: program errors

  • F: none of the above

Solution A

Q5.2

What does this program output?

print 1 "2"

Choose one correct answer:

  • A:

    1 2
    
  • B:

    1 "2"
    
  • C:

    print 1 "2"
    
  • E: program errors

  • F: none of the above

Solution A

Q5.3

What does this program output?

print 1 "2

Choose one correct answer:

  • A:

    1 2
    
  • B:

    1 "2"
    
  • C:

    print 1 "2"
    
  • E: program errors

  • F: none of the above

Solution E

Q5.4

What does this program output?

print +1 "2"

Choose one correct answer:

  • A:

    1 2
    
  • B:

    1 "2"
    
  • C:

    print 1 "2"
    
  • E: program errors

  • F: none of the above

Solution E

Q5.5

What does this program output?

print "3" .5

Choose one correct answer:

  • A:

    3 .5
    
  • B:

    "3" .5
    
  • C:

    print "3" .5
    
  • E: program errors

  • F: none of the above

Solution E

Q6.1

Which program creates the following output?

true false

Choose three correct answers:

  • A:

    print "true" false
    
  • B:

    print "true false"
    
  • C:

    print true false
    
  • D:

    print "tru" false
    
Solution A,B,C

Q6.2

Which program creates the following output?

1 2

Choose three correct answers:

  • A:

    print "1" 2
    
  • B:

    print "1 2"
    
  • C:

    print 1 2
    
  • D:

    print "1 " 2
    
Solution A,B,C

Q6.3

Which program creates the following output?

true 2

Choose three correct answers:

  • A:

    print "true" 2
    
  • B:

    print "tru 2"
    
  • C:

    print true 2
    
  • D:

    print true "2"
    
Solution A,C,D

Q7.1

What type is the argument of the color command?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution A

Q7.2

What type is the argument of the circle command?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution C

Q7.3

What type is the argument of the width command?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution C

Q7.4

What type is the argument of the clear command if there is one given?

Choose one correct answer:

  • A: string
  • B: bool
  • C: num
  • D: none of the above
Solution A