GoConqr has a new look! Let us know what you think.

Quiz

Loops, Function and strings

Kaithlyn Reyes 14 questions

Take the quiz

Questions in this quiz (14)

  1. 1myString.isupper() method returns a string in upper case
    1. ATrue
    2. BFalse
  2. 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.
    1. Atrue
    2. Bfalse
  3. 3Given the following string:

    str = "This is a Quiz!"

    both statements will return the same character

    str[8]

    str[-7]
    1. Atrue
    2. Bfalse
  4. 4All of the following string methods require a substring as an argument.

    endswith()

    replace()

    find()
    1. Atrue
    2. Bfalse
  5. 5The following is a valid function definition:

    def _getInput():

    name = input()

    return name
    1. Atrue
    2. Bfalse
  6. 6A statement in one function can access a local variable in another function.
    1. Atrue
    2. Bfalse
  7. 7The argument is assigned the value of a parameter when the function is called.
    1. Atrue
    2. Bfalse
  8. 8The built-in input() function is an example of a void function.
    1. Atrue
    2. Bfalse
  9. 9A function that is defined will never execute unless it is called.
    1. Atrue
    2. Bfalse
  10. 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.
    1. Atrue
    2. Bfalse

Information

Description
Quiz on Loops, Function and strings, created by Kaithlyn Reyes on 15/11/2022.
Language
English
Views
6
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?