Sail E0 Webinar

MCQs

Total Questions : 50 | Page 3 of 5 pages
Question 21. Choose the correct syntax of the split function:
  1.    x.split[]
  2.    split(x)
  3.    x.split(",", 3)
  4.    X.SPLIT(",", 3)
 Discuss Question
Answer: Option C. -> x.split(",", 3)
Question 22. Which one of these is floor division?
  1.    /
  2.    //
  3.    %
  4.    None of the mentioned
 Discuss Question
Answer: Option B. -> //
Question 23. People = ["John", "Rob", "Bob"]print (people[1]) what would this result be?
  1.    John
  2.    Rob
  3.    Bob
 Discuss Question
Answer: Option B. -> Rob
Question 24. What does the following code do? myAge = int (myAge)
  1.    Converts the var (variable) myAge to a string
  2.    Converts the var (variable) myAge to a integer
  3.    Converts the var (variable) myAge from a integer to a string
  4.    Converts the var (variable) myAge to if statement
 Discuss Question
Answer: Option B. -> Converts the var (variable) myAge to a integer
Question 25. Which statement correctly assigns the string "Tanner" to the variable name?
  1.    name  = print( "Tanner")
  2.    input("Tanner")
  3.    name = "Tanner"
  4.    name = input("Tanner")
 Discuss Question
Answer: Option C. -> name = "Tanner"
Question 26. To solve a problem that requires the user to enter 10 numbers would use what type of iteration?
  1.    While loop
  2.    For loop
  3.    Variable
  4.    Selection
 Discuss Question
Answer: Option B. -> For loop
Question 27. What will be the output?name = "Dave"print (name)
  1.    Dave
  2.    'Dave'
  3.    name
  4.    (name)
 Discuss Question
Answer: Option A. -> Dave
Question 28. Which of these is the correct code for creating a list of names?
  1.    nameList = John, Harry, Jesse, John, Harry, Harry
  2.    nameList = ("John", "Harry", "Jesse", "John", "Harry", "Harry")
  3.    nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
  4.    nameList = [John, Harry, Jesse, John, Harry, Harry]
 Discuss Question
Answer: Option C. -> nameList = ["John", "Harry", "Jesse", "John", "Harry", "Harry"]
Question 29. Which type of loop iterates until instructed otherwise?
  1.    FOR loop
  2.    WHILE loop
 Discuss Question
Answer: Option B. -> WHILE loop
Question 30. What button do you press to compile (run) your program so that it runs in the shell?
  1.    F3
  2.    F5
  3.    F7
  4.    F9
 Discuss Question
Answer: Option B. -> F5

Latest Videos

Latest Test Papers