Cᴏᴅᴇs Sɴɪᴘᴘᴇᴛs
Ir al canal en Telegram
👩💻 Wᴇʟᴄᴏᴍᴇ ᴛᴏ @CodesSnippet! 🚀 Jᴏɪɴ ᴜs ғᴏʀ ᴅᴀɪʟʏ sɴɪᴘᴘᴇᴛs ᴏғ ᴄᴏᴅɪɴɢ 🧩 ᴋɴᴏᴡʟᴇᴅɢᴇ! 💻💡 Hᴇʀᴇ, ʏᴏᴜ'ʟʟ ғɪɴᴅ 👀 ʙɪᴛᴇ-sɪᴢᴇᴅ ᴘɪᴇᴄᴇs ᴏғ ᴄᴏᴅᴇ, 🔥 ᴘʀᴏɢʀᴀᴍᴍɪɴɢ ᴛɪᴘs, ᴀɴᴅ ᴛʀɪᴄᴋs ᴛᴏ ʟᴇᴠᴇʟ ᴜᴘ ʏᴏᴜʀ ᴄᴏᴅɪɴɢ sᴋɪʟʟs! 💪💻 Sᴛᴀʏ ᴜᴘᴅᴀᴛᴇᴅ ᴏɴ ᴛʜᴇ ʟᴀᴛᴇsᴛ ᴛʀᴇɴᴅs ɪɴ ᴛᴇᴄʜ
Mostrar másEl país no está especificadoTecnologías y Aplicaciones51 481
305
Suscriptores
Sin datos24 horas
-67 días
-630 días
Archivo de publicaciones
Repost from Python Codes Basic to Advance
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))
Python won the "Best Community Support" award. Which year was it recognized for having the most helpful community?
What will be the output of the following Python code?
print("abc DEF".capitalize())
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
