0% found this document useful (0 votes)
68 views7 pages

ALX Evaluation Quiz #3

barua ya shule

Uploaded by

TEQSTO MERCHANTS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
68 views7 pages

ALX Evaluation Quiz #3

barua ya shule

Uploaded by

TEQSTO MERCHANTS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

8/7/22, 10:22 AM Evaluation Quiz Corrections - show | Addis Ababa Intranet

(/)

Evaluation quiz correction


Evaluation Quiz: Evaluation #3

Date: 2022-07-20

Status: Done

Duration: 25 minutes

Score: 100.0%

# "I don't know": 0

# Success: 17

# Fail: 0

Responses

0. What is the unistd symbolic constant for the standard output?


Score: 1.0

STDIN_FILENO
STDOUT_FILENO
STDERR_FIELNO
I don't know

1. What do these lines print?


Score: 1.0

>>> def my_function(counter=89):


>>> return counter + 1
>>>
>>> print(my_function()) 

https://alx-intranet.hbtn.io/evaluation_quiz_corrections/251562 1/7
8/7/22, 10:22 AM Evaluation Quiz Corrections - show | Addis Ababa Intranet

1
(/)
89
90
891
I don't know

2. In a doubly linked list, what’s the “head” of a linked list?


Score: 1.0

It's the node with the pointer to the next node equals to NULL
It's the node with the pointer to the previous node equals to NULL
I don't know

3. In a doubly linked list, what are possible directions to traverse it?


Score: 1.0

(select all possible answers)

Forward
Backward
I don't know

4. What does this print?


Score: 1.0

>>> print("{:d} Mission street, {}".format(972, "San Francisco"))

"972 Mission street, San Francisco"


72 Mission street, San
972 Mission street, San Francisco
San Francisco Mission street, 972
I don't know

https://alx-intranet.hbtn.io/evaluation_quiz_corrections/251562 2/7
8/7/22, 10:22 AM Evaluation Quiz Corrections - show | Addis Ababa Intranet

5. How many bytes will this statement allocate on a 64 bit machine?


(/)
Score: 1.0

malloc(sizeof(char) * 4)

4
8
12
16
I don't know

6. You're standing in line at a grocery store, which data type best represents this situation?
Score: 1.0

Queue
Array
Dictionary
Stack
I don't know

7. What do these lines print?


Score: 1.0

>>> def my_function(counter=89):


>>> print("Counter: {}".format(counter))
>>>
>>> my_function(12)

Counter: 12
Counter: 89
Counter: 101
I don't know

8. What's wrong with the following C code to get the nth node of a linked list? 

https://alx-intranet.hbtn.io/evaluation_quiz_corrections/251562 3/7
8/7/22, 10:22 AM Evaluation Quiz Corrections - show | Addis Ababa Intranet

Score: 1.0
(/)
Select all correct answers.

#include "lists.h"
/**
* get_nodeint_at_index - finds nth node of a listint_t list
* @head: list to evaluate
* @index: index of node to find
*
* Return: node found at index (SUCCESS), NULL if node does not exist
**/

listint_t *get_nodeint_at_index(listint_t *head, unsigned int index)


{
unsigned int i;
listint_t *ptr;

if (head == NULL)
return (NULL);

ptr = head;
i = 0;

while (i < index)


{
ptr = ptr->next;
i++;
}

return (ptr);
}

There is no check for if ptr->next is NULL before moving ptr


The function should not return NULL if head is not found.
If index is out of range, the program should return NULL
Nothing is wrong
I don't know

9. What do these lines print?


Score: 1.0

>>> a = [1, 2, 3, 4]
>>> a[2] = 10
>>> a

https://alx-intranet.hbtn.io/evaluation_quiz_corrections/251562 4/7
8/7/22, 10:22 AM Evaluation Quiz Corrections - show | Addis Ababa Intranet

[1, 2, 3, 4]
(/)
[1, 10, 3, 4]
[1, 2, 10, 4]
[1, 2, 10, 10]
I don't know

10. What do these lines print?


Score: 1.0

for i in range(2, 10, 2):


print(i, end=" ")

2 3 4 5 6 7 8 9 10
23456789
4 6 8 10 12 14 16 18
2468
I don't know

11. What does this print?


Score: 1.0

>>> a = "Python is cool"


>>> print(a[7:-5])

on
nohtyP
Python
si
is
I don't know

12. What do these lines print?



Score: 1.0

https://alx-intranet.hbtn.io/evaluation_quiz_corrections/251562 5/7
8/7/22, 10:22 AM Evaluation Quiz Corrections - show | Addis Ababa Intranet

>>> a = { 'id': 89, 'name': "John", 'projects': [1, 2, 3, 4], 'friends': [ { 'id': 82, 'name': "Bob" },
(/)
{ 'id': 83, 'name': "Amy" } ] }
>>> a.get('friends')[-1].get("name")

89
[{'id':82, 'name':"Bob"}, {'id':83, 'name': "Amy"}]
'Amy'
'Bob'
Nothing
I don't know

13. What is a circular import in Python?


Score: 1.0

When two or more modules are dependant on each other.


When you import a module for calculating dimensions for circles.
When one module imports multiple other modules.
I don't know

14. Which symbol should I use to redirect the error output to the standard output?
Score: 1.0

2>&1
1>&2
2>
I don't know

15. Which line of code will create a list of every other number from 0 to 10 in reverse in
Python?
Score: 1.0

list(range(10, 0, -2))
array(range(10, 0, -2))

https://alx-intranet.hbtn.io/evaluation_quiz_corrections/251562 6/7
8/7/22, 10:22 AM Evaluation Quiz Corrections - show | Addis Ababa Intranet

list(range(0, 10, -2))


(/)
array(10, 0, 2))
I don't know

16. What do these lines print?


Score: 1.0

a = 12
if a > 2:
if a % 2 == 0:
print("Tech")
else:
print("C is fun")
else:
print("School")

Tech
C is fun
School
I don't know

Copyright © 2022 ALX, All rights reserved.

https://alx-intranet.hbtn.io/evaluation_quiz_corrections/251562 7/7

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy