Quiz
Loops, Function and strings
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem 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.
- ARichtig
- BFalsch
12In a nested loop, the inner loop goes through all of its iterations for every single iteration of the outer loop.
- ARichtig
- BFalsch
13To calculate the total number of iterations of a nested loop, add the number of iterations of all the loops.
- ARichtig
- BFalsch
14The process of input validation using loop, iterates when the user of a program enters invalid data.
- ARichtig
- BFalsch
Informationen
- Beschreibung
- Quiz am Loops, Function and strings, erstellt von Kaithlyn Reyes am 15/11/2022.
- Autor
- Kaithlyn Reyes
- Sprache
- English
- Aufrufe
- 6
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz