Write a NumPy program to create a vector of length 5 filled with arbitrary integers from 0 to 10

  • برمجة بايثون

Write a NumPy program to create a vector of length 5 filled with arbitrary integers from 0 to 10.

الأجوبة

import numpy as np
x = np.random.randint(0, 11, 5)
print("Vector of length 5 filled with arbitrary integers from 0 to 10:")
print(x)

Sample Output:

Vector of length 5 filled with arbitrary integers from 0 to 10:
[ 0 10  2  0  6]
هل كان المحتوى مفيد؟

تبحث عن مدرس اونلاين؟

محتاج مساعدة باختيار المدرس الافضل؟ تواصل مع فريقنا الان لمساعدتك بتأمين افضل مدرس
ماهو التخصص الذي تبحث عنه؟
اكتب هنا...