Section mcq’s choice Choice Choice 1,2 Choice 1,3,5


Download 63.22 Kb.
bet2/8
Sana03.06.2024
Hajmi63.22 Kb.
#1840512
1   2   3   4   5   6   7   8
Bog'liq
CODER EXAM

Response 1 - 2,4,1,2,1,1
Response 2 – 4,4,5,5,1,1


  1. What is the output in Python? Explain.

# reassignment
a = [1, 2, 3, 4]
b = a
a += [5, 6, 7, 8]
print(a)
print(b)
# extends
a = [1, 2, 3, 4]
b = a
a.extend([5, 6, 7, 8])
print(a)
print(b)
Response 1 – 2,5,1,3,1,1
Response 2 - 3,5,5, 5,1,1

  1. Explain this code to me:

import React, { useState } from 'react';
import './App.css';
function App() {
const [isPopupOpen, setIsPopupOpen] = useState(false);
const openPopup = () => {
setIsPopupOpen(true);
};
const closePopup = () => {
setIsPopupOpen(false);
};

return (



{isPopupOpen && (


×

Hello, How are you?





)}

);
}
export default App;
Response 1 - 5,5,5,5,1,1
Response 2 - 5,2,5,5,1,1


  1. Write a generator to yield the Fibonacci numbers in Python.

Response 1 – 5,5,5,5,1,1
Response 2 – 3,5,5,5,1,1


  1. Why don't I need a try/catch here:

with open('resource_file.py') as open_file:
if open_file.length > 100:
raise Exception('File too big to parse')
```"

Response 1 – 4,3,5,5,1,1
Response 2 – 2,3,4,2,1,1


  1. How can i include 'e_core_web_lg' in a python script in a way, that makes it possible for 'pyinstaller' to create an '.exe’

Response 1 – 5,5,5,5,1,1
Response 2 – 5,3,5,5,1,1


  1. I need a program in C++ that converts a binary number into a hexadecimal number. Allow an input entry for the binary number. Add comments to all the code.

Response 1 – 1,2,5,1,1,1

Download 63.22 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling