Quiz
Loops, Function and strings
Crie uma conta grátis para terminar este quiz
Salve seu progresso e veja sua nota final.
Já tem uma conta? Inicie sessão
Perguntas do quiz (14)
1myString.isupper() method returns a string in upper case
- ATrue
- BFalse
2When checking if a string is a sub-string of another, both the in operator and the find(substring) method can be used. Both will return a True value when the substring is part of the given string.
- Atrue
- Bfalse
3Given the following string:
str = "This is a Quiz!"
both statements will return the same character
str[8]
str[-7]- Atrue
- Bfalse
4All of the following string methods require a substring as an argument.
endswith()
replace()
find()- Atrue
- Bfalse
5The following is a valid function definition:
def _getInput():
name = input()
return name- Atrue
- Bfalse
6A statement in one function can access a local variable in another function.
- Atrue
- Bfalse
7The argument is assigned the value of a parameter when the function is called.
- Atrue
- Bfalse
8The built-in input() function is an example of a void function.
- Atrue
- Bfalse
9A function that is defined will never execute unless it is called.
- Atrue
- Bfalse
10global number
def function1(number):
number += 7
return number
number = 5
number = function1(number)
print(number)
From the given code, the variable number in function1() is used as a global variable.- Atrue
- Bfalse
11Input validation is a way to design a program such that bad input will never be accepted to avoid producing bad output.
- AVerdadeiro
- BFalso
12In a nested loop, the inner loop goes through all of its iterations for every single iteration of the outer loop.
- AVerdadeiro
- BFalso
13To calculate the total number of iterations of a nested loop, add the number of iterations of all the loops.
- AVerdadeiro
- BFalso
14The process of input validation using loop, iterates when the user of a program enters invalid data.
- AVerdadeiro
- BFalso
Informações
- Descrição
- Quiz sobre Loops, Function and strings, criado por Kaithlyn Reyes em 15-11-2022.
- Autor
- Kaithlyn Reyes
- Idioma
- English
- Visualizações
- 6
- Avaliação
- Ainda sem avaliações Avalie este quiz