PyData Careers
20.9K subscribers
205 photos
4 videos
26 files
351 links
Python Data Science jobs, interview tips, and career insights for aspiring professionals.

Admin: @HusseinSheikho || @Hussein_Sheikho
Download Telegram
Interview question

What is the output of the following code?
x = [1, 2, 3]
y = x
y.append(4)
print(x)

Answer:
[1, 2, 3, 4]

tags: #python #interview #coding #programming #datastructures #list #mutable #dev

By: t.iss.one/DataScienceQ 🚀
Interview question

**What will be the output of this code?**
```python
x = [1, 2, 3]
y = x[:]
y[0] = 10
print(x)
```

Answer:
<spoiler>||[1, 2, 3]||</spoiler>

tags: #python #interview #coding #programming #list #slicing #mutable #dev

By: t.iss.one/DataScienceQ 🚀
⁉️ Interview question

What is the output of the following code?
import copy

a = [1, 2, [3, 4]]
b = copy.deepcopy(a)
b[2][0] = 'X'
print(a[2][0])

Answer:
3

#⃣ tags: #python #advanced #coding #programming #interview #deepcopy #mutable #dev

By: t.iss.one/DataScienceQ 🚀
⁉️ Interview question

What is the output of the following code?
def func(a, b=[]):
b.append(a)
return b

print(func(1))
print(func(2))

Answer:
[1, 2]

#⃣ tags: #python #advanced #coding #programming #interview #defaultarguments #mutable #dev

By: t.iss.one/DataScienceQ 🚀