¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

CS 1101 Week 5

Usuario eliminado 13 preguntas Actualizado el 23 sep 2016

Hacer el test

Preguntas del test (13)

  1. 1What does the function subroutine do?

    def subroutine(n):
    while n>0:
    print(n,)
    n-=1
    1. ACounts down from 10 to 0 and displays each number
    2. BCounts from n down to 1 and displays each number
    3. CCalculates the sum of n numbers greater than 0
    4. DCalculates the mean of n
  2. 2What output will the following python command produce:

    >>>percentage = float (60*100)/50
    >>>print(percentage)
    1. Apercentage
    2. B109
    3. C109.0909090909091
    4. D109.0
  3. 3What outputs will the following python commands produce:
    n=10000
    count=0
    while n:
    count=count+1
    n=n//10

    print(count)
    1. A5
    2. B0
    3. C10000
    4. D1000
  4. 4What output will the following python commands produce:

    x=5
    if x%2==0:
    print(x)
    else:
    print(x,x%2)
    1. A5
    2. B5 1
    3. C2
    4. D5 0
  5. 5What is the output of the following statements?

    pi=float(3.14159)
    print(pi)
    1. A3
    2. B3.0
    3. C3.14159
    4. D0
  6. 6Expressions evaluate to either True or False:. What will the output of the following code be when the expression "Ni!" is evaluated?

    if "Ni!"
    print("We are the knights who say, "Ni!")
    else
    print("Stop it! No more of this!")
    1. AStop it!
    2. BWe are the knights who say, "Ni!"
    3. CStop it! No more of this!
    4. DNo output will be produced
  7. 7What output will the following python commands produce:

    x=1
    y=2
    if x==y:
    print(x,"and",y,"are equal")
    else
    if x<y:
    print(x,"is less than", y)
    else
    print(x,"is greater than",y)
    1. A1 and 2 are equal
    2. B1 is less than 2
    3. C1 is greater than 2
    4. D2 is greater than 2
  8. 8The following code is an example of what principle?

    bruce=5
    print(bruce,)
    bruce=7
    print(bruce)
    1. AMultiple Assignment
    2. BAn iteration or loop structure
    3. CA logical operator
    4. DA conditional operator
  9. 9The % or modulus operator returns the remainder present when two integers do not divide evenly into one another
    1. AVerdadero
    2. BFalso
  10. 10An algorithm is a step by step process for solving a problem
    1. AVerdadero
    2. BFalso

Información

Descripción
El usuario ha eliminado su información de asignaturas Test sobre CS 1101 Week 5 , creado por Usuario eliminado el 22/09/2016.
Autor
Usuario eliminado
Idioma
English
Visitas
46
Historial
Creado el 22 sep 2016 · actualizado el 23 sep 2016

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?