Python Tutorial to learn Python programming with examples

Complete Python Tutorial for Beginners Playlist :

Python Tutorial in Hindi :

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

Rs ChudasamaAugust 16, 2019 at 10:05 pm1st Assignment:

vals=array('i',[1,2,5,3,6])

newarr=sorted(vals)

print(newarr)

2nd Assignment:

from math import *

num=int(input('Enter a number')

print(factorial(num))

varun krishna kyathanpallyAugust 16, 2019 at 10:05 pm2nd quiz question answer

x = input("enter the number for the factorial")

i = 1

fact = 1

while i<x:

fact = fact * x

x = x-1

print (fact)

Agathiyan JanardhanaAugust 16, 2019 at 10:05 pmproblem 2

a=int(input('number for factorial'))

fact=1

for i in range(1,a+1):

fact=fact*i

print(fact)

Saritha BathiniAugust 16, 2019 at 10:05 pmThank you very much for your valuable videos on python..it's simply amazing. You made Python very simple and easy to understand. Once again thank you for your effort.

shaukat khattakAugust 16, 2019 at 10:05 pmarray code does not work in my pycharm why i write as same as you sir

Vikram KrishnaAugust 16, 2019 at 10:05 pmexcellent explanation sir especially while saying about coping array values into a new array

Srinivas RamachandranAugust 16, 2019 at 10:05 pmfrom array import *

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

for a in vals:

b = 1

for a in range(1,a+1):

a=a*b

b=a

print(a, end='')

print()

alek 126August 16, 2019 at 10:05 pmSecond

I = int(input("gimme a num"))

e=1

While I>0

e=e*I

I=I-1

Print(e)

SOUBATHA TAugust 16, 2019 at 10:05 pm#1

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

z=1

for i in range(1,num+1)

z=i*z

print(z)

Onkar Pawar.August 16, 2019 at 10:05 pm1. A code to sort the array in ascending order

alphabets = array('u', ['a', 'q', 'b', 'k', 'z', 'f'])

print(sorted(alphabets))

nums = array('i', [55, 7, 0, 65, 20, 34])

print(sorted(nums))

2. A code to find the factorial of given number

fact = array('i', [2, 5, 3, 7])

for f in fact:

print(factorial(f))

FitnessKanackeAugust 16, 2019 at 10:05 pmYou are a very good teacher. Love your Python tutorials! Thank you!!

Rtk SoniAugust 16, 2019 at 10:05 pmsir im enjoying the python course

you are doing such A GRAET WORK

sainathreddy gangireddyAugust 16, 2019 at 10:05 pmLove you sir jiππ..I am enjoying your teaching β€

Krishna JadhavAugust 16, 2019 at 10:05 pmIndia needs more teacher like u….we pay laks of fees to clg and learns nothing .

Riyaz mhdAugust 16, 2019 at 10:05 pm1.from array import *

arr=array('i', [3,2,6,1])

print(sorted(arr))

2.n=int(input("enter the input"))

fact=1

for i in range(1,n+1):

fact=fact*i

print(fact)

honey sharmaAugust 16, 2019 at 10:05 pmpls do reply me navin .I HAD A DOUBT THAT ,,LETS 'A' BE AN ARRAY ,

CAN WE DO LIKE THIS

A=ARRAY('U',[1,2,3])

B=A

IN THIS CASE ADDRESS OF BOTH ARE SAME,,,

B=ARRAY('U',[1,2,3]),

HERE ADDRESS ARE DIFFERENT ,,BUT THEY SHOULD BE SAME NO,,AS EARLIER YU TAUGHT THE CONCEPT OF OBJECT ,,

b=array(a.typecode,(a for a in a))

HERE ALSO ADRESS ARE DIFFERNT BUT AGAIN SHOULD BE SAME,,PLS REPLY ,I HAD BEEN MESSED UP….

vivek kumar sharmaAugust 16, 2019 at 10:05 pm# Factorial number

nums = int(input("Enter the factorial number >> "))

fact = 1

for num in range(1,nums+1):

fact = num * fact

print(fact)

vivek kumar sharmaAugust 16, 2019 at 10:05 pmfrom numpy import *

arr = array([2,3,56,5,7],int)

for i in range(len(arr)):

for j in range(4-i):

if arr[i] > arr[i+1]:

temp = arr[i]

arr[i] = arr[i+1]

arr[i+1] = temp

print(arr)

Aniket KashyapAugust 16, 2019 at 10:05 pm1st answer:-

From array import *

arr=array('u',[βaβ,βrβ,βrβ,βaβ,βyβ])

arr1=sorted(arr)

for i in arr1

print(i)

2nd answer

Import math

Val=int(input(βenter valueβ))

Print(math.factorial(val))

Y ShreyasAugust 16, 2019 at 10:05 pmfor factorial

x=int(input("enter a number you want"))

fact=1

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

fact=fact*i

print(fact)

Y ShreyasAugust 16, 2019 at 10:05 pmcan anybody tells me how to arrange elements in an array in ascending order?

Om ChoudharyAugust 16, 2019 at 10:05 pmIn 14:27 what is the connection of 'a' with vals ??π. What does 'a' mean ??

Baljot Singh ChoudharyAugust 16, 2019 at 10:05 pmCan we use newarr=val[:]

Prince VegetaAugust 16, 2019 at 10:05 pmFor Question #2, without importing math

—

x = int(input('pick a number to find its factorial '))

y = x

i = 0

while True:

i+=1

if i == y:

print(x)

break

x = x * (y – (i))

—-

feel free to give feedback

Prince VegetaAugust 16, 2019 at 10:05 pmI see many people using sorted for first question.

This is one way of doing it without using sorted:

from array import *

ara = array('i', [5, 6, 2, 8,])

x = 0

while True:

x+=1

for i in ara:

if i == x:

print(i)

if x > max(ara):

break

however, negative numbers don't work. Can anyone point in the right direction to do it the long way without using sorted.

And as always never stop teaching Navin, you have special talent.

Gaurao MateAugust 16, 2019 at 10:05 pmFactorial

import math

val=math.factorial(23)

print("The factorial is",val)

The factorial is 25852016738884976640000

Binay MohantaAugust 16, 2019 at 10:05 pmimport math

x=int(input('enter the value:'))

if x==0:

print("Factorial is: 1")

else:

for i in range(1,x):

x=x*i

print("Factorial is:",x)

Fahim RahmanAugust 16, 2019 at 10:05 pmFor Floating type my code is:

import array as a

cgpa = a.array('f',[2.87,3.06,3.03,3.21,3.06,3.06])

for n in cgpa:

print(n)

I got output:

2.869999885559082

3.059999942779541

3.0299999713897705

3.2100000381469727

3.059999942779541

3.059999942779541

why i'm getting extra digits after the floating point?