Sam Gue
Quiz por , criado more than 1 year ago

Quiz sobre Python programming language, criado por Sam Gue em 25-05-2014.

37
1
1
Sam Gue
Criado por Sam Gue aproximadamente 10 anos atrás
Fechar

Python programming language

Questão 1 de 10

1

Variables: How do you form a variable?

Selecione uma das seguintes:

  • variable_name = ("variable_content")

  • variable_name = ["variable_content"]

  • variable_name = {"variable_content"}

  • variable_name = "variable_content"

Explicação

Questão 2 de 10

1

If statements: What follows an if statement?

Selecione uma das seguintes:

  • A colon :

  • An equals =

  • A semi-colon ;

Explicação

Questão 3 de 10

1

If statements: what are the other statements?

Selecione uma das seguintes:

  • Elseif and Else

  • Elif and Else

Explicação

Questão 4 de 10

1

Loops: How do you form a while loop?

Selecione uma das seguintes:

  • while 'X' then:

  • while 'X':

Explicação

Questão 5 de 10

1

Loops: What will this 'for loop' do?: for i in range(5):

Selecione uma das seguintes:

  • repeat the number five forever

  • repeat something five times

  • repeat five things, five times

Explicação

Questão 6 de 10

1

String indexing: print(word[3]), what will happen?

Selecione uma das seguintes:

  • it will print word three times

  • it will print the third letter in word

  • it will print the third item in the list: word

  • it will print the fourth letter in word

Explicação

Questão 7 de 10

1

Lists: how do you add something to a list?

Selecione uma das seguintes:

  • list_name.add(value)

  • list_name.input(value)

  • append(value).list_name

  • list_name.append(value)

Explicação

Questão 8 de 10

1

Functions: How do you form a user defined function?

Selecione uma das seguintes:

  • define function_name():
    return X

  • def function_name():
    return X

Explicação

Questão 9 de 10

1

Text Files: How do you open and close a reading text file?

Selecione uma das seguintes:

  • file_name.open("X.txt", "r")

  • file_name.open("X.txt", "r+")

  • file_name.open("X.txt", "w")

  • file_name.open("X.txt", "a")

Explicação

Questão 10 de 10

1

Procedures: What does a procedure lack as opposed to a User Defined Function

Selecione uma das seguintes:

  • return X

  • def procedure_name():

Explicação