uz
Feedback
Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs

Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs

Kanalga Telegram’da o‘tish

👩‍💻 Wᴇʟᴄᴏᴍᴇ ᴛᴏ @CodesSnippet! 🚀 Jᴏɪɴ ᴜs ғᴏʀ ᴅᴀɪʟʏ sɴɪᴘᴘᴇᴛs ᴏғ ᴄᴏᴅɪɴɢ 🧩 ᴋɴᴏᴡʟᴇᴅɢᴇ! 💻💡 Hᴇʀᴇ, ʏᴏᴜ'ʟʟ ғɪɴᴅ 👀 ʙɪᴛᴇ-sɪᴢᴇᴅ ᴘɪᴇᴄᴇs ᴏғ ᴄᴏᴅᴇ, 🔥 ᴘʀᴏɢʀᴀᴍᴍɪɴɢ ᴛɪᴘs, ᴀɴᴅ ᴛʀɪᴄᴋs ᴛᴏ ʟᴇᴠᴇʟ ᴜᴘ ʏᴏᴜʀ ᴄᴏᴅɪɴɢ sᴋɪʟʟs! 💪💻 Sᴛᴀʏ ᴜᴘᴅᴀᴛᴇᴅ ᴏɴ ᴛʜᴇ ʟᴀᴛᴇsᴛ ᴛʀᴇɴᴅs ɪɴ ᴛᴇᴄʜ

Ko'proq ko'rsatish
305
Obunachilar
Ma'lumot yo'q24 soatlar
-67 kunlar
-630 kunlar
Postlar arxiv
way to create array and perform operation using numpy.
pip install numpy
code :
import numpy as n

# creating array
d=n.array([1,2,3])
d2=n.array([4,5,6])
print(d) #it doesnt seperated with comma
print(d2) #it doesnt seperated with comma
# performing operation
print(d+d2) #it adds the corresponding elements of the arrays
print(d2-d)  #it subtracts the corresponding elements of the arrays

print(d*d2)  #it multiplies the corresponding elements of the arrays

#similary you can do operation with single element
d3=n.array([10])
print(d*d3)  
print(d+d3)
print(d-d3)
Output:-
[1 2 3]
[4 5 6]
[5 7 9]
[3 3 3]
[ 4 10 18]
[10 20 30]
[11 12 13]
[-9 -8 -7]

What will be the output of the following Python code? print("xyyzxyzxzxyy".count('yy', 1))
Anonymous voting

print((3 > 2) > 1)
Anonymous voting

Python won the "Best Community Support" award. Which year was it recognized for having the most helpful community?
Anonymous voting

How to set margin top and bottom in Tailwindcss ?
Anonymous voting

How can we set margin top and bottom in Tailwindcss ?
Anonymous voting

How can we write margin from top and bottom in tailwindcss?
Anonymous voting

What will be the output of the following Python code? print("abc DEF".capitalize())
Anonymous voting

What is the output of the above puthon code
Anonymous voting

a = [1, 2, 3] 
a.append([4, 5]) 
print(len(a))

Which tag is used to create a dropdown in HTML Form?
Anonymous voting

Guess the correct option
Anonymous voting

Guess the correct answer...
Guess the correct answer...

What's the right answer?
Anonymous voting

⌨️ Python Quiz
⌨️ Python Quiz

Which of the following is a mutable data type in Python?
Anonymous voting

By using sys.getsizeof(), you can easily measure the memory consumption of different data structures, helping you make informed decisions about which to use based on resource availability.
import sys
list1=[1,2,3,4,5]
tup1=(1,2,3,4,5)
print(sys.getsizeof(list1),"bytes")
print(sys.getsizeof(tup1),"bytes")
Output :
104 bytes
80 bytes

[Program finished]
📱 Join us for more Python tips: @CodesSnippet #pythonhandbook #pythonbook #python3 #python

tuples=(1,2,4,5) X,y=tuples print (X,y)
Anonymous voting

tuples=(1,2,4,5) X,*y=tuples print (X,y)
Anonymous voting