Test
Python programming language
Preguntas del test (10)
1Variables: How do you form a variable?
- Avariable_name = ("variable_content")
- Bvariable_name = ["variable_content"]
- Cvariable_name = {"variable_content"}
- Dvariable_name = "variable_content"
2If statements: What follows an if statement?
- AA colon :
- BAn equals =
- CA semi-colon ;
3If statements: what are the other statements?
- AElseif and Else
- BElif and Else
4Loops: How do you form a while loop?
- Awhile 'X' then:
- Bwhile 'X':
5Loops: What will this 'for loop' do?: for i in range(5):
- Arepeat the number five forever
- Brepeat something five times
- Crepeat five things, five times
6String indexing: print(word[3]), what will happen?
- Ait will print word three times
- Bit will print the third letter in word
- Cit will print the third item in the list: word
- Dit will print the fourth letter in word
7Lists: how do you add something to a list?
- Alist_name.add(value)
- Blist_name.input(value)
- Cappend(value).list_name
- Dlist_name.append(value)
8Functions: How do you form a user defined function?
- Adefine function_name():
return X - Bdef function_name():
return X
- Adefine function_name():
9Text Files: How do you open and close a reading text file?
- Afile_name.open("X.txt", "r")
- Bfile_name.open("X.txt", "r+")
- Cfile_name.open("X.txt", "w")
- Dfile_name.open("X.txt", "a")
10Procedures: What does a procedure lack as opposed to a User Defined Function
- Areturn X
- Bdef procedure_name():
Información
- Descripción
- Test sobre Python programming language, creado por Sam Gue el 25/05/2014.
- Autor
- Sam Gue
- Idioma
- English
- Visitas
- 60
- Etiquetas
- Valoración
- 5,0 de 5 · 1 valoración Valora este test