Python Tutorial to learn Python programming with examples

Complete Python Tutorial for Beginners Playlist :

Python Tutorial in Hindi :

Github :-

In this video we will see:

– Why Array?

– Advantage of Array in Python

– When to use Array

– Importing module

– Creating Array

– Type of array

– Type code

– Storing value in array

– Printing array values

– buffer_info function

– Printing type code

– reverse function

– Printing value of specific index

– Printing values using loop

– Printing length of array

– Creating array of unicode value

– Creating new array by copying existing array

– Copying type from old array

Editing Monitors :

Check out our website:

Follow Telusko on Twitter:

Follow on Facebook:

Telusko :

Navin Reddy :

Follow Navin Reddy on Instagram:

Subscribe to our other channel:

Navin Reddy :

Telusko Hindi :

Donation:

PayPal Id : navinreddy20

Patreon : navinreddy20

Nguồn: https://benjaminjcohen.com/

Xem thêm bài viết khác: https://benjaminjcohen.com/cong-nghe/

Sir in your teaching techniques is very technical and just realised you to something me it's good for understanding thanks and bye baii

Love you 3000😍

make series of videos on Data structure and algorithms

Why your hair is greenish ?

from array import *

a= array('i',[5,54,1,5,8,7,30,45])

for i in range(len(a)):

for j in range(len(a)):

if a[i]<a[j]:

a[i],a[j]=a[j],a[i]

print(a)

Hii sir..@13:24 you used array(Val's.typecode, (a for a in vals))

Isn't it necessary to end a for with : ??

The only thing I didn't get it is why not just write:

Array1 = Array2 –> This give you another array with the same values as the first, no?

from array import *

arr=array('i',[2,4,5,7,0,1,6,2,4,5])

arr1=sorted(arr)

print(f"{arr} after sorting{arr1}")

"But you can use while loop"

from math import *

x = int(input("Enter the number that you wanna factorial : "))

print(factorial(x))

from array import *

array = [45,65,76,78,89,43,44,56]

array.sort()

print(array)

import array as arr

x = arr.array('i',[5,4,3,2,1])

print("before sort:",x)

k = 0

for e in range(5):

for e1 in range(5):

if e > e1:

e,e1 = e1,e

k+=1

print("n after sort:",x)

Great Job..! Very helpful..!

1st answer

from array import *

vals= array ('i',[5,9,8,4,2])

for i in range(len(vals)):

for j in range (len(vals)-1):

if vals[j]>vals[j+1]:

temp=vals[j]

vals[j]=vals[j+1]

vals[j+1]=temp

print(vals)

2nd answer

from array import *

vals= array ('i',[5,9,8,4,2])

x=int(input("Enter the element you want to find : "))

for i in range(len(vals)):

if vals[i]==x :

print("Element found")

break

else :

print("Element not found")

Palindrome in python how to do this programming

since we have list (builtin class) whats the need for array in python?

Superb. I have never seen so attractive way of learning. Thanks alot 🙂 🙂

#1

From array import *

v=array('i',[9,3,5,6])

x=sorted(v)

for e in x:

Print(e)

#2

Import math

V=int(input ("enter a number"))

Print(math.factorial(V))

sir ur assigment question is not properly visible due to Telusko Logo..

you are to good

First:-

from array import *

values = list(array ('i',(2,5,3,7,1)

val.sort()

for i in val:

print(i)

Second:-

val=6

i=1

c=1

while i<=val:

c=c*i

i=i+1

print("Factorial =",c)

import math

from array import *

vals = array('i',[1,2,3,4,-2])

newarr = array(vals.typecode,(a*a for a in vals))

for i in range (len(newarr)):

print(vals[i])

enen this above couldn't fetch the square vals of vals

please help!!

Navin sir, to get duplicate can I use –> newArr=vals[:] ?

how to user input the array

every beginner needs u only…waste of money & time by joining coachins….

I love your teaching skills(pls become my home tutor )

😀

For factorial of a number

x=int(input('Please enter your number'))

j=i=1

while i<x+1:

j=j*i

i=i+1

print(j)

sir could you suggest me a book by indian author for learning python and also if i use function id and pass array as a argument i get different address as compared when i use function buffer_info on array i get diffrent address

for factorial

n = int(input("Enter no. to find factorial:"))

f = 1

for i in range(n):

f = f * n

n-=1

print(f)

import array as ar

vals = ar.array('l',[21,35,21,52,53,96])

print(vals)

print(vals.buffer_info())

print(id(vals),len(vals))

'''result: array('l', [21, 35, 21, 52, 53, 96])

(115130180272, 6)

115130124784 6'''

please explain why id is different .

thank you

Thank you Navin Reddy for the amazing python series.

Code to find out factorial of given number.

x = int(input("Enter a number:"))

#

temp = x

#

if x > 1:

for i in range(1,x-1):

a = temp * (x-i)

temp = a

print("Factorial of ",x,"is ",a)

else:

print("Factorial of 0 or 1 is 1")

Note: if we follow this logic, then iteration would be (x-2) times. But if we use index to find factorial like fact=fact*i, the iteration would be x times.

Please correct me, I am not efficient.

Hi Navin, when copying array content from vals to newArr , we could have simply assigned. newArr = vals. Am I missing something here.? Or would there be any issue in real time programming ?>

Hi sir your explanation is so nice.

Thanks so much sir❤❤