Those who can not see the assignment due to Playlist in front of questions.. The assignment que. is: 1) Create an array with 5 values & delete the value at index no. 2 without using in-built function. 2) write a code to reverse an array without using in-built function.
@@vivekveeraswamyalli7787 bro there are different online platforms you can search for on browser with host special competitions..coding and this is called competitive coding..by participating and winning here you get grades and stars which you can mention in your resume or cv's...which can give u pretty decent placement and jobs.
Hi Navin Reddy, thank you so much for the sessions. 1) # To create array with 5 elements and delete element with index value 2: from array import * arr = array('i',[]) # len = int(input("Enter length of array:")) # for i in range(len): ele = int(input("Enter elements:")) arr.append(ele) print(arr) # for d in range(len): if d == 2: arr.pop(d) print(arr) # OR for d in range(len): if d == 2: del arr[2] print(arr) ********************************** 2.a) Reversing array: from array import * arr = array('u',['a','b','c','d']) len = len(arr) # for i in range(int(len/2)): temp = arr[i] arr[i] = arr[len-i-1] arr[len-i-1] = temp print("The reversed array is:",arr) ******************************************* 2.b) Creating new array with reversing of existing array: from array import * # arr = array('u',['a','b','c','d']) # len = len(arr) arr1 = array(arr.typecode,[]) # i = 1 while i
BRO their are some mistakes in your 1st answer.. Correct 1st answer is: from array import * arr=array('i',[]) for i in range(5): x=int(input("Enter the next value")) arr.append(x) print(arr) k=0 for e in arr: if k==2: arr.pop(k) k=k+1 print(arr)
Hey what if I use while loop and decrement the value of l to print the reverse array like: L=len(arr) i=0 While (L-1>i): Print(arr[L]) L=L-1 Plz help I'm confused as error comes of index out of range @Sathishkumar S
@@GAMINGWITHDESTRYER want to remove the video and channel link at the end to see assignment ?? Inspect element and edit as html and remove that part and enter.
Thanks for your tutorial. Qs.1: import array arr = array.array('i',[]) n = int(input("Enter the length of array")) for i in range(n): data = int(input("Enter the array value")) arr.append(data) print(arr) arr2 = array.array('i',[]) item = int(input("Enter the element you wish to remove:")) for delete in arr: if delete == item: continue else: arr2.append(delete) print(arr2) Qs.2: import array arr = array.array('i',[1,5,10,15,20,25]) print(arr) NewArr = array.array('i',[]) for i in range(6): for j in arr: if i == arr.index(j): NewArr.append(arr[5-i]) print(NewArr)
Sir ji TUSSI GREAT HO. College time me kabhi coding nahi sikhi or nahi kabhi mann kiya but jab 5 saal baad lga mechanical me bhi coding important h and then I thought, let's give it a try. My brother and one friend suggested your channel and after going through your videos I never felt like coding is difficult. From your course, I realized that the only thing required for coding is logic. More you apply logic, more simpler will be a language. Really thankyou for efforts and HATS OFF to your energy while expalining! Love you pal :)
In my quest to learn Python and to start from basic, I went to google to understand OOP concept a week back and got to your channel purely by chance...That session was truly awesome, which brought me to your series on Python and I could simply say that I am loving it, every single minute is a learning, .....Also shared your details with many of my friends and colleagues...You have really great teaching skills..Good Teacher could be a good programmer but every good programmer can not be a good Teacher...THANKS
1. from array import * arr = array('i',[]) for i in range(5): x= int(input("enter values")) arr.append(x) print(arr) numbers=arr print("Deleted element is :",numbers.pop(2)) print("Current elements are:",numbers) 2. from array import * arr = array('u',[]) for i in range(5): x= (input("enter character")) arr.append(x) print("Before Reversing Array:",arr) arr.reverse() print("After reversing Array:",arr) Thank You Sir...Love from West Bengal...and sir now i realized that my time at the lock down was not wasted.
'''answer for the first question''' import array as a arr=a.array("i",[]) lent=int(input("Enter the length of array : ")) for i in range(lent): val=int(input("Enter the elements of array one by one and press enter")) arr.append(val) print(arr) arr2=a.array('i',[]) del_elm=int(input("Enter the element you wish to remove/delete : ")) for element in arr: if del_elm==element: continue else: arr2.append(element) print("The new array is : ",arr2)
@@noelrakshit The answer of first question from array import * x=array('i',[1,2,3,4,5]) y=array('i',[]) n=int(input('enter Index no.')) for i in range(len(x)): if(i==n): continue y.append(x[i]) x=y print(x)
I am your BIG follower............ i hav subscribed u r channel in 4 of my phones..., a laptop ..and shared to many friends..... tq faa helping in learning PYTHON ........ "i am an alien of U"............ ; )
Hello Navin Reddy, I personally think it would be nice if you make videos on all the data-science libraries and make a separate playlist of it.(Pandas, scikit, matplotliib, scipy and also maybe tensorflow).
# code for 2nd Q,s from array import * arr = array("i", [ ]) for i in range(4): x = int(input("Enter the value: ")) arr.append(x) print(arr) b = array('i', []) for i in range(4): b.append(arr[-(i+1)]) print(b)
#1 from array import * arr = array('i', []) n = int(input("Enter the length of array elements: ")) for e in range(n): x=int(input("Enter the array elements: ")) arr.append(x) print(arr) arr.remove(2) print(arr) #2 Reverse the array newarr = array('i', []) c=len(arr) for j in range(c): y=arr[c-j-1] newarr.append(y) print(newarr) Thanks!
You can block the playlist with ad blocker. It says: 1. Create an array with 5 values and delete the value at index number 2 without using in-built functions. 2. Write a code to reverse an array without using in-built functions.
Question ( 2 ) : from array import * x = array('i', [1, 2, 3, 4, 5]) print(x) y = array(x.typecode, (a for a in x)) counter = len(x)-1 for i in x: y[counter] = i counter -= 1 print(y)
My Solution, asking value no. as well arr = array ('i', []) x = int(input('Enter the Length: ')) for i in range(x): print ('Enter Value', i+1, ':', end="") a = int(input()) arr.append(a) print(arr) Great Learning Thanks Navin :)
27.1 from array import * arr = array ('i',[]) n = int(input("length of array = ")) for i in range(n): x = int(input("enter the next number = ")) arr.append(x) print (arr) arr1 = array('i',[]) i =0 while (i
hi navin, u r one of the best teachers whom i came across. great job kudos for that. one small problem here is after every episode u give a assignment to finish ryt, but due to adds n stuff of your other courses we are not able to see the assignments properly, can u please adjust that. thanks
sir ur python series is the best that i could find on youtube... may be because of ur clear cut explanation or the way u teach... sir please bring us with more series in 2020 to improve ourselves and tq somuch for this series sir...
Hello! Your videos are great. Just one suggestion: At the end of every video, the pop-ups about your previous video and the Telusuko logo actually block the assignment questions. So, can you pls type the assignment question in the description as well, or maybe you have a better solution? But I personally feel you have to do something about it. Thank you Great work :)
from array import * import math arr = array('i',[]) n = int (input("enter the length of array")) for a in range (n): x = int(input("enter array value")) arr.append(x) print("orignal array") print(arr) k = int(n/2) # numbers of iteration d=n-1 for i in range(k): j = arr[i] u = arr[d] arr[d] = j arr[i] = u d=d-1 print("after reverse") print(arr)
Removing element at index 2: import array as arr vals = arr.array('i', []) num = int(input("Enter the length of the array: ")) for i in range(num): x = int(input("Enter the next value: ")) vals.append(x) print(vals) vals.pop(2) print(vals)
27.2 Reverse an array without using function from array import * arr = array ('i',[]) n = int(input("length of array = ")) for i in range(n): x = int(input("enter the next number = ")) arr.append(x) print (arr) revarr = array('i',[]) i = 0 while(i
1. arr=[2, 5, 3, 9, 1] Narr=[] for e in arr: if e==arr[2]: continue Narr.append(e) print(Narr) 2. from array import * ar=array('i', [2, 5, 3, 9, 1]) inver=array(ar.typecode,[]) for i in range(len(ar)): inver.append(ar[len(ar)-i-1]) print(inver)
#for del. pos 2 in array from array import * a = array('i',[3,2,9,1,8]) b = array('i',[]) for e in range(0,2): b.append(a[e]) for e in range(3,len(a)): b.append(a[e]) print(b) #for reversing array from array import * a = array('i',[1,2,3,4,8,9]) b = array('i',[]) for i in range(1,6): b.append(a[-i]) for i in range(0,1): b.append(a[i]) print(b)
1st sol: from array import * arr=array("i",[]) n = int(input("Enter the lenght of array")) for i in range(n): x=int(input("Enter the value ")) arr.append(x) print(arr) d=int(input("Enter the value to be deleted")) k=0 for e in arr: if k==d: arr.remove(e) k+=1 print(arr) thanks telusko
Assignment Q 1. To create array with 5 elements and delete element with index value 2. Q2a) reversing a array without using inbuilt function .b) Creating new array with reversing of existing array
2nd program: from array import * a = array('i',[]) n = int(input("Enter a length of an array")) for i in range(n): x = int(input("Enter a Value")) a.append(x) for e in range(1,len(a)+1): b = a[-e] print(b)
Hello sir, I am engineering first year student and I genuinely love your videos, all your content is fantastic. Just one suggestion from my side, at the end of the video you give a small quiz question which I want to solve but I can't see it because of the end screen (Subscribe and playlist button). Please rearrange the icons on the end screen so that we can see and solve the quiz question. Thank you
@@seemapassi6550 from array import * arr=array("i",[1,2,3,4,5]) reqarr=array("i",[]) for i in range(len(arr)): if i==2: continue reqarr. apend(arr[i]) print(reqarr) Output: array("i",[1,2,4,5])
Exercise 1: from array import * capture_bb = array ('i', [6,8,38,60,61,98,70,40] capture_bb.sort() for i in capture_bb: print (capture_bb) Output: array('i',[6,8,38,40,60,61,70,98] Thank you so much!!
2.sol: from array import * arr = array('i',[]) n = int(input('enter the size of the array')) for i in range(n): x = int(input('enter the next value:')) arr.append(x) print(arr) a = array('l',[]) for l in range(n): k=0 while l
1st quize code: from array import * arr = array('i',[]) n=int(input("enter the number of values in array")) for i in range(n): val=int(input("enter the next value")) arr.append(val) print(arr) arr.pop(1) """ sir without using pop we cant delete a value from array atleast this inbuilt function we have to use""" output: enter the number of values in array4 enter the next value3 array('i', [3]) enter the next value2 array('i', [3, 2]) enter the next value1 array('i', [3, 2, 1]) enter the next value5 array('i', [3, 2, 1, 5]) >>> arr array('i', [3, 1, 5]) 2nd quize code: from array import array arr= array('i',[]) n=int(input("how many numbers u want to add in the array")) for i in range(n): x = int(input("enter the next value")) arr.append(x) print("your array is " ,end="") """for reversing""" for e in range(n//2): temp=arr[e] arr[e]=arr[-(e+1)] arr[-(e+1)]=temp print(arr) OUTPUT: how many numbers u want to add in the array7 enter the next value1 enter the next value2 enter the next value3 enter the next value4 enter the next value5 enter the next value6 enter the next value7 your array is array('i', [7, 6, 5, 4, 3, 2, 1]) >>>
for e in range(n//2): temp=arr[e] arr[e]=arr[-(e+1)] arr[-(e+1)]=temp instead of this we can use for e in range(n//2): arr[-(e-1)],arr[e]=arr[e],arr[-(e-1)]
from array import * a=array("i",[]) n=int(input("enter the length")) for i in range(n): x=int(input("enter the next value")) a.append(x) print(a) n=int(input('enter the value for delete')) for e in a: if e==n: a.remove(e) print(a)
1st.. from array import * arr=array('i',[]) n=int(input("enter the lenth")) for i in range(n): x=int(input("enter the next number")) arr.append(x) arr.pop(2) print(arr)
Will you please remove the end screen cards on your videos I can't seen the assignment part or you add the assignment in the video part. It's a request to you.
1-creat an array with 5 values and delete the value at index number 2 without using in build function 2-write a code to reverse an array without using in build function
1st Q from array import * x=array('i',[]) print("Enter 5 values") for i in range(5): x.append(int(input())) for j in range(4): if j>=2 : x[j]=x[j+1] for k in range(4): print(x[k])
2) from array import * a=array('i',[]) n=int(input("enter size of array")) for i in range(n): x=int(input("enter next value")) a.append(x) print(a) b=array('i',[]) for k in range(n-1,-1,-1): b.append(a[k]) print(b) print("thank you sir")
1) from array import * a=array('i',[]) for i in range(5): x=int(input("enter values")) a.append(x) print(a) y=int(input("enter the value to be removed"))
k=0 for e in a: if e==y: a.remove(e) else: continue print(a) thank you sir
from array import * vals = array('i',[10,11,12,13,14]) print("Array elements before deletion: {0}".format(vals)) vals = vals[:2]+vals[3:] print("Array elements post deletion: {0}".format(vals))
1) from array import * arr = array('i',[ ]) for i in range(5) : x = int(input("Enter the value :")) arr.append(x) print(arr) for i in range(5) : if i == 2 : continue print(arr[i],end = " ") print("
from array import * arr = array('i', []) n = int(input("Enter the length of the array")) for i in range(n): x = int(input("Enter the next value")) arr.append(x) print("Original array elements:", end=" ") for i in range(n): print(arr[i], end=" ") print() y = int(input("enter element to delete")) for i in range(n): if arr[i] == y: break pos = i if pos < n-1: for j in range(pos,n-1,1): arr[j] = arr[j+1] n = n-1 elif pos == n-1: n = n-1 print("Elements in array after deletion", end=" ") for k in range(n): print(arr[k], end=" ") print()
Mixed both question 1 & 2 1)from array import* arr = array('i',[]) n = int(input("What is the length of array")) for i in range(n): x =int(input("What is the next value of the array")) arr.append(x) print(arr) val = int(input("what is the value to be searched & deleted")) k = 0 for e in arr: if e == val: print(k) arr.remove(arr[k]) break
from array import * a=array('i',[]) n=int(input("enter size of array")) for i in range(n): x=int(input('enter the value')) a.append(x) print(a) x=int(input("enter the index no. by which you want to delete element")) b=array('i',[]) for i in range(n-1): if i
for defining typecode and it's input accordingly: from array import * types = str(input('enter data type code:')) a = array(types, []) length = int(input('enter array length')) for i in range(length): if types == 'b' or types == 'B' or types == 'u': x = str(input('enter elements:')) a.append(x) else: x = int(input('enter elements:')) a.append(x) print(a)
for deleting an element in array: from array import* list1=[ ] for i in range(6): list1.append (int(input("Enter the value for array"))) print (list1) v=array('i',[ ]) print(array('i',list1)) n=int(input("Enter the value to be removed from the array ")) for a in list1: if a==n: continue v.append(a) print(v)
Those who can not see the assignment due to Playlist in front of questions.. The assignment que. is:
1) Create an array with 5 values & delete the value at index no. 2 without using in-built function.
2) write a code to reverse an array without using in-built function.
@Prabesh Guragain at the end of the video u can see that...
@Prabesh Guragain in python series video no. #23 at time 7:42 u can see [upper(right side)] assignment
how did you removed that playlist??
@@Alexmercer0 i m not removed any Playlist itself.. I m just guessing + and i tried to saw the question little bit. 😋
Yes the video thumbnail recommendation is hiding the assignment questions in most of the videos.
i do competitive coding, whenever i get confused with basic fundamentals , your channel is where i land. thanks bro . 🙌
What is competitive coding?
what is mean by competitive coding..?
@@vivekveeraswamyalli7787 bro there are different online platforms you can search for on browser with host special competitions..coding and this is called competitive coding..by participating and winning here you get grades and stars which you can mention in your resume or cv's...which can give u pretty decent placement and jobs.
Hi @nishantsharma3100 , would you suggest a place I can start competitive coding. Let's just say I know python only from Telusko videos
the way he says "bye bye " at the end of the video makes me to feel something special....
if this is how you satisfy your need to feel special.. you are definitely in a need of girlfriend bro. :-D
Lol !!!
Are you gay bro 🧐
@@HARSH-jj1qj ask ur dad? Is he gaya or not.
If yes, u were adopted.
@@FonxyStar you are LGBTQ
Hi Navin Reddy, thank you so much for the sessions.
1)
# To create array with 5 elements and delete element with index value 2:
from array import *
arr = array('i',[])
#
len = int(input("Enter length of array:"))
#
for i in range(len):
ele = int(input("Enter elements:"))
arr.append(ele)
print(arr)
#
for d in range(len):
if d == 2:
arr.pop(d)
print(arr)
# OR
for d in range(len):
if d == 2:
del arr[2]
print(arr)
**********************************
2.a) Reversing array:
from array import *
arr = array('u',['a','b','c','d'])
len = len(arr)
#
for i in range(int(len/2)):
temp = arr[i]
arr[i] = arr[len-i-1]
arr[len-i-1] = temp
print("The reversed array is:",arr)
*******************************************
2.b) Creating new array with reversing of existing array:
from array import *
#
arr = array('u',['a','b','c','d'])
#
len = len(arr)
arr1 = array(arr.typecode,[])
#
i = 1
while i
BRO their are some mistakes in your 1st answer..
Correct 1st answer is:
from array import *
arr=array('i',[])
for i in range(5):
x=int(input("Enter the next value"))
arr.append(x)
print(arr)
k=0
for e in arr:
if k==2:
arr.pop(k)
k=k+1
print(arr)
Also bro he asked not to use in-built functions
@@gauravbisht9622
there is a mistake towards the end
arr.pop(e)
@@thenoxai ahhhh sry maaah bad
Hey what if I use while loop and decrement the value of l to print the reverse array like:
L=len(arr)
i=0
While (L-1>i):
Print(arr[L])
L=L-1
Plz help I'm confused as error comes of index out of range
@Sathishkumar S
You are one of the best teachers for the programming language.
Go a head.
NaveenBhau, I'm Binge watching your PythON series since this morning. They are quite good. Thanks and Greetings from Switzerland.
Hi sir! Just wanted to say your videos are inspiring and to the point. Love them.
really
how to remove End screen
@@GAMINGWITHDESTRYER want to remove the video and channel link at the end to see assignment ?? Inspect element and edit as html and remove that part and enter.
@@yashjain2370 Thank you!
Thanks for your tutorial.
Qs.1:
import array
arr = array.array('i',[])
n = int(input("Enter the length of array"))
for i in range(n):
data = int(input("Enter the array value"))
arr.append(data)
print(arr)
arr2 = array.array('i',[])
item = int(input("Enter the element you wish to remove:"))
for delete in arr:
if delete == item:
continue
else:
arr2.append(delete)
print(arr2)
Qs.2:
import array
arr = array.array('i',[1,5,10,15,20,25])
print(arr)
NewArr = array.array('i',[])
for i in range(6):
for j in arr:
if i == arr.index(j):
NewArr.append(arr[5-i])
print(NewArr)
# Second Program
from array import *
arr = array('i',[10,20,30,40,50,60,70,80,90,100])
print(arr[::-1])
What result you got there
superb bro
can you explain the working?
Gud work
goooddddd
Sir ji TUSSI GREAT HO. College time me kabhi coding nahi sikhi or nahi kabhi mann kiya but jab 5 saal baad lga mechanical me bhi coding important h and then I thought, let's give it a try.
My brother and one friend suggested your channel and after going through your videos I never felt like coding is difficult. From your course, I realized that the only thing required for coding is logic. More you apply logic, more simpler will be a language. Really thankyou for efforts and HATS OFF to your energy while expalining! Love you pal :)
Navin sir, I just want to say thank you for this knowledge that you're providing us. Hats off🙏🏻🙏🏻
In my quest to learn Python and to start from basic, I went to google to understand OOP concept a week back and got to your channel purely by chance...That session was truly awesome, which brought me to your series on Python and I could simply say that I am loving it, every single minute is a learning, .....Also shared your details with many of my friends and colleagues...You have really great teaching skills..Good Teacher could be a good programmer but every good programmer can not be a good Teacher...THANKS
yup this quarantine is python's by Navin sir
by the way, they are amazing
1.
from array import *
arr = array('i',[])
for i in range(5):
x= int(input("enter values"))
arr.append(x)
print(arr)
numbers=arr
print("Deleted element is :",numbers.pop(2))
print("Current elements are:",numbers)
2.
from array import *
arr = array('u',[])
for i in range(5):
x= (input("enter character"))
arr.append(x)
print("Before Reversing Array:",arr)
arr.reverse()
print("After reversing Array:",arr)
Thank You Sir...Love from West Bengal...and sir now i realized that my time at the lock down was not wasted.
Naveen the way you teach is fabulous and here I request you to teach SQL because it's you who can only make it fun learning SQL. All the best
Vijay Roy yes sql
I also want that u teach sql
Me too sir
Me too, please do it.
Yeah do videos on sql sir
Hi, there are so many channels in youtube for python tutorials, but the way you describe its uniqe and very understable. keep the pace.
'''answer for the first question'''
import array as a
arr=a.array("i",[])
lent=int(input("Enter the length of array : "))
for i in range(lent):
val=int(input("Enter the elements of array one by one and press enter"))
arr.append(val)
print(arr)
arr2=a.array('i',[])
del_elm=int(input("Enter the element you wish to remove/delete : "))
for element in arr:
if del_elm==element:
continue
else:
arr2.append(element)
print("The new array is :
",arr2)
Bro, it doesn't remove the value at the index. However, its a good code.
@@noelrakshit
The answer of first question
from array import *
x=array('i',[1,2,3,4,5])
y=array('i',[])
n=int(input('enter Index no.'))
for i in range(len(x)):
if(i==n):
continue
y.append(x[i])
x=y
print(x)
@@nalinmahajan1337 that was to the point af boi
I am your BIG follower............
i hav subscribed u r channel in 4 of my phones..., a laptop ..and shared to many friends.....
tq faa helping in learning PYTHON ........ "i am an alien of U"............ ; )
Thankyou sir! Your Python tutorials have made my quarantine productive .
I read out the video description and try out the programs or exercises before watching the video. This is an effective method.
i can not see the assignment question on assignment question his playlist and channel logo pops up
yes me too dude , that end screen cards are blocking it .. ! sad
Telusko channel can only disable it!
Pause the video and then slowly slide down the video. You'll now be able to see the assignment question
@@yogeshjain5907 what if I'm using a pc :)
Factorial
I saw so many classes about phython sir,but no chanel is not have clear cut theme sir,but u are very very simplier the concepts sir,tnq sir
Hello Navin Reddy, I personally think it would be nice if you make videos on all the data-science libraries and make a separate playlist of it.(Pandas, scikit, matplotliib, scipy and also maybe tensorflow).
The energy with which u explain is commendable. U make learning python fun. Thanks for such tutorials
# code for 2nd Q,s
from array import *
arr = array("i", [ ])
for i in range(4):
x = int(input("Enter the value: "))
arr.append(x)
print(arr)
b = array('i', [])
for i in range(4):
b.append(arr[-(i+1)])
print(b)
First
I am really really thankful from you. you are the best teacher that I have seen. be successful in whole of your life
the amazing energy you have sir is too good❤
#1
from array import *
arr = array('i', [])
n = int(input("Enter the length of array elements: "))
for e in range(n):
x=int(input("Enter the array elements: "))
arr.append(x)
print(arr)
arr.remove(2)
print(arr)
#2 Reverse the array
newarr = array('i', [])
c=len(arr)
for j in range(c):
y=arr[c-j-1]
newarr.append(y)
print(newarr)
Thanks!
Not able to see the assignment question at the end of these videos, It is hidden by Django playlist
me too
You can block the playlist with ad blocker. It says:
1. Create an array with 5 values and delete the value at index number 2 without using in-built functions.
2. Write a code to reverse an array without using in-built functions.
@@dimitarzortev7199 thanks bro to assignment.
@@dimitarzortev7199 Thank you very much!
@@dimitarzortev7199 Thank you
1.
from array import *
a=array('i',[10,20,30,40])
b=array(a.typecode,[])
i=0
while i
Question ( 2 ) :
from array import *
x = array('i', [1, 2, 3, 4, 5])
print(x)
y = array(x.typecode, (a for a in x))
counter = len(x)-1
for i in x:
y[counter] = i
counter -= 1
print(y)
Simply can use ::-1 method
My Solution, asking value no. as well
arr = array ('i', [])
x = int(input('Enter the Length: '))
for i in range(x):
print ('Enter Value', i+1, ':', end="")
a = int(input())
arr.append(a)
print(arr)
Great Learning Thanks Navin :)
2)reverse
from array import *
arr=array('i',[1,2,3,4,5])
k=-len(arr)-1
for i in range(-1,k,-1):
print(arr[i])
How did you learn this code?
27.1
from array import *
arr = array ('i',[])
n = int(input("length of array = "))
for i in range(n):
x = int(input("enter the next number = "))
arr.append(x)
print (arr)
arr1 = array('i',[])
i =0
while (i
Next video card at the end of the videos are troubling me to see the questions assignments. Please rearrange these to give a clear view of questions.
hi navin, u r one of the best teachers whom i came across. great job kudos for that. one small problem here is after every episode u give a assignment to finish ryt, but due to adds n stuff of your other courses we are not able to see the assignments properly, can u please adjust that. thanks
1st sol:
from array import *
arr=array('i',[2,9,8,7,6])
print(arr[0:2]+arr[3:])
2ns sol:(reverse)
from array import *
arr=array('i',[10,22,55,78,90])
print(arr[::-1])
what does it mean ::
sir ur python series is the best that i could find on youtube...
may be because of ur clear cut explanation or the way u teach...
sir please bring us with more series in 2020 to improve ourselves and tq somuch for this series sir...
Hello!
Your videos are great. Just one suggestion: At the end of every video, the pop-ups about your previous video and the Telusuko logo actually block the assignment questions. So, can you pls type the assignment question in the description as well, or maybe you have a better solution? But I personally feel you have to do something about it.
Thank you
Great work :)
exactly
yes
Best teacher i ever came across in my life lots of love and respect
from array import *
from math import *
vals= array('i',[12,34,14,5,16])
vals=array('i',(a for a in vals if vals.index(a)!=2));
print(vals)
12,34,5,16
Sir your way of teaching is very good i have no words for describing.
love your videos and also loves u alot...
1). question
from array import*
arr=array ('i',[1,2,3,4,5])
for i in arr:
if i==arr[2]:
continue
print (i)
if i==arr[2]: means arr[2] represent 3rd number position of the array then skip 3rd number values of array.
Sahi nahi aa raga
sir am form non IT background and by watching your videos feel very comfortable in python. Thanks a lot sir.
Navin, I love learning programming in a funny way :)
Every one understand firmly ur classes sir.... Good job... 🙏🙏🤝🤝👍👍
#ReversingArray
from array import *
arr = array('i',[40,30,20,10,55,77])
print(arr[::-1])
explain the last line please
@@pikachu6626 it is slicing... [startValue:endValue:jumpValue]...refer internet about slicing
The orignal array is not reversing .this code is just displaying the values in reverse.
from array import *
import math
arr = array('i',[])
n = int (input("enter the length of array"))
for a in range (n):
x = int(input("enter array value"))
arr.append(x)
print("orignal array")
print(arr)
k = int(n/2) # numbers of iteration
d=n-1
for i in range(k):
j = arr[i]
u = arr[d]
arr[d] = j
arr[i] = u
d=d-1
print("after reverse")
print(arr)
@@mirzaebrahimbaig5633 newArrR = array('i',newArr[::-1])
best teacher of all. Couldn't find anyone better. best best best...
Reverse😁
from array import*
arr =array('i', [2, 4 ,56 ,23, 46])
k= len(arr) - 1
while k > -1:
print(arr[k])
k -= 1
Thats not the reverse of an array its only printing in values of an array from last to first...
@@turbosardar39 yeah it's nonsense and other 18 people liked r bigger blockheads
@@stockfish3379 for second question
from array import*
arr=array('i',[2,4,7,8,9])
newarr=array('i',[])
for e in range(len(arr)):
if e
Removing element at index 2:
import array as arr
vals = arr.array('i', [])
num = int(input("Enter the length of the array: "))
for i in range(num):
x = int(input("Enter the next value: "))
vals.append(x)
print(vals)
vals.pop(2)
print(vals)
Without using inbuilt function
n=int(input("enter a size of array "))
a=array("i",[int(input()) for x in range(n)])
print(a)
27.2 Reverse an array without using function
from array import *
arr = array ('i',[])
n = int(input("length of array = "))
for i in range(n):
x = int(input("enter the next number = "))
arr.append(x)
print (arr)
revarr = array('i',[])
i = 0
while(i
1.
arr=[2, 5, 3, 9, 1]
Narr=[]
for e in arr:
if e==arr[2]:
continue
Narr.append(e)
print(Narr)
2.
from array import *
ar=array('i', [2, 5, 3, 9, 1])
inver=array(ar.typecode,[])
for i in range(len(ar)):
inver.append(ar[len(ar)-i-1])
print(inver)
from array import *
val =array('i',[1,23,12,44,10,13,4])
i=0
j=len(val)-1
while(i
question 1
from array import *
arr=array('i',[1,2,3,4,5])
k=2
for x in arr:
if x==2:
arr.pop(x)
print(arr)
you used in built function pop
hi sir, i really love the way you teach programming languages. getting inspired from your
teachings
#for del. pos 2 in array
from array import *
a = array('i',[3,2,9,1,8])
b = array('i',[])
for e in range(0,2):
b.append(a[e])
for e in range(3,len(a)):
b.append(a[e])
print(b)
#for reversing array
from array import *
a = array('i',[1,2,3,4,8,9])
b = array('i',[])
for i in range(1,6):
b.append(a[-i])
for i in range(0,1):
b.append(a[i])
print(b)
why (0, 1)?
1st sol:
from array import *
arr=array("i",[])
n = int(input("Enter the lenght of array"))
for i in range(n):
x=int(input("Enter the value "))
arr.append(x)
print(arr)
d=int(input("Enter the value to be deleted"))
k=0
for e in arr:
if k==d:
arr.remove(e)
k+=1
print(arr)
thanks telusko
Assignment
Q 1. To create array with 5 elements and delete element with index value 2.
Q2a) reversing a array without using inbuilt function .b) Creating new array with reversing of existing array
2nd program:
from array import *
a = array('i',[])
n = int(input("Enter a length of an array"))
for i in range(n):
x = int(input("Enter a Value"))
a.append(x)
for e in range(1,len(a)+1):
b = a[-e]
print(b)
Sir the end screens are covering the assignments
Hello sir, I am engineering first year student and I genuinely love your videos, all your content is fantastic. Just one suggestion from my side, at the end of the video you give a small quiz question which I want to solve but I can't see it because of the end screen (Subscribe and playlist button). Please rearrange the icons on the end screen so that we can see and solve the quiz question. Thank you
from array import *
A=array('i',[1,2,3,4,5])
print(A)
for i in range(5):
if(i==2):
continue
print(A[i])
OUTPUT-:
array('i', [1, 2, 3, 4, 5])
1
2
4
5
Aditya Chand
that's ok but can you write in the array form
@@seemapassi6550
from array import *
arr=array("i",[1,2,3,4,5])
reqarr=array("i",[])
for i in range(len(arr)):
if i==2:
continue
reqarr. apend(arr[i])
print(reqarr)
Output:
array("i",[1,2,4,5])
@@karthikjonnala5837 error its append not apend
@@karthikjonnala5837 thanx bro
Wow nice thinking
Exercise 1:
from array import *
capture_bb = array ('i', [6,8,38,60,61,98,70,40]
capture_bb.sort()
for i in capture_bb:
print (capture_bb)
Output:
array('i',[6,8,38,40,60,61,70,98]
Thank you so much!!
you have to make it without using inbuilt function
sir as I noticed after using a.remove()
size also got decreased by 1 but when we are trying to do it manually we are not able to decrease size
after wards just use del arry[len(arry)-1]
best tutorials in the internet just amazing
Hey Navin, You are Some man..
I got this for you
Navin=My Bad
print(Navin)
>> My Bad..
hahahhahaha You r Great Man. Love From Bangalore
thats a wrong code bro u have given a string in the print it prints navin only...lol
@@Anonymousss07 i think it wont print anything brother because he didnt defined mybad
U'll get an error coz.. string must be place in single quotes
2.sol:
from array import *
arr = array('i',[])
n = int(input('enter the size of the array'))
for i in range(n):
x = int(input('enter the next value:'))
arr.append(x)
print(arr)
a = array('l',[])
for l in range(n):
k=0
while l
1st quize code:
from array import *
arr = array('i',[])
n=int(input("enter the number of values in array"))
for i in range(n):
val=int(input("enter the next value"))
arr.append(val)
print(arr)
arr.pop(1) """ sir without using pop we cant delete a value from array atleast this inbuilt
function we have to use"""
output:
enter the number of values in array4
enter the next value3
array('i', [3])
enter the next value2
array('i', [3, 2])
enter the next value1
array('i', [3, 2, 1])
enter the next value5
array('i', [3, 2, 1, 5])
>>> arr
array('i', [3, 1, 5])
2nd quize code:
from array import array
arr= array('i',[])
n=int(input("how many numbers u want to add in the array"))
for i in range(n):
x = int(input("enter the next value"))
arr.append(x)
print("your array is " ,end="")
"""for reversing"""
for e in range(n//2):
temp=arr[e]
arr[e]=arr[-(e+1)]
arr[-(e+1)]=temp
print(arr)
OUTPUT:
how many numbers u want to add in the array7
enter the next value1
enter the next value2
enter the next value3
enter the next value4
enter the next value5
enter the next value6
enter the next value7
your array is array('i', [7, 6, 5, 4, 3, 2, 1])
>>>
Hi.. can you please explain how the second query works..??
for e in range(n//2):
temp=arr[e]
arr[e]=arr[-(e+1)]
arr[-(e+1)]=temp
instead of this we can use
for e in range(n//2):
arr[-(e-1)],arr[e]=arr[e],arr[-(e-1)]
sry it is
arr[e],arr[n-e-1]=arr[n-e-1],arr[e]
you have to pop the value at index no.2
for the 1st program:
from array import *
arr = array('i',[23,12,34,54,89])
for i in range(len(arr)):
if(i==2):
continue
print(arr[i])
from array import *
a=array("i",[])
n=int(input("enter the length"))
for i in range(n):
x=int(input("enter the next value"))
a.append(x)
print(a)
n=int(input('enter the value for delete'))
for e in a:
if e==n:
a.remove(e)
print(a)
You have made concepts very simple for beginners, just like in bangalore we have Manjunath Aradhya Sir. Very good, All the best.
from array import *
a = array('d', [1,2,3,4,5])
print(a)
for i in range (5):
if i==2:
continue;
print (a[i])
thank you. it was a simple code and got me so confused
1st..
from array import *
arr=array('i',[])
n=int(input("enter the lenth"))
for i in range(n):
x=int(input("enter the next number"))
arr.append(x)
arr.pop(2)
print(arr)
u have to write it without using built in functions
Will you please remove the end screen cards on your videos I can't seen the assignment part or you add the assignment in the video part. It's a request to you.
1-creat an array with 5 values and delete the value at index number 2 without using in build function
2-write a code to reverse an array without using in build function
@@mahmouddaragmeh5198 thanks
@@mahmouddaragmeh5198 thanx
@@mahmouddaragmeh5198 thx
1st Q
from array import *
x=array('i',[])
print("Enter 5 values")
for i in range(5):
x.append(int(input()))
for j in range(4):
if j>=2 :
x[j]=x[j+1]
for k in range(4):
print(x[k])
Wow, beautiful explanation sir. The way you are Explaining is in very understandable manner.
2. Write a code to reverse an array without using an in-built function
myArr = array('i', [12, 7, 85, 50, 63])
print(myArr[-1::-1])
2)
from array import *
a=array('i',[])
n=int(input("enter size of array"))
for i in range(n):
x=int(input("enter next value"))
a.append(x)
print(a)
b=array('i',[])
for k in range(n-1,-1,-1):
b.append(a[k])
print(b)
print("thank you sir")
If only I could heart react your videos like I do on instagram.
1)
from array import *
a=array('i',[])
for i in range(5):
x=int(input("enter values"))
a.append(x)
print(a)
y=int(input("enter the value to be removed"))
k=0
for e in a:
if e==y:
a.remove(e)
else:
continue
print(a)
thank you sir
One day when I will earn good money, you will get a good donation from me!:)
I have watched many python videos, but your's the best.
wow, I like ur dynamic coding teaching style. Thank u!!
I already entered n ,and it feels so good for a beginner.You are so good
Dude this guy is the best programming teacher online
mr navin you the best in teaching python thank you so much
from array import *
vals = array('i',[10,11,12,13,14])
print("Array elements before deletion: {0}".format(vals))
vals = vals[:2]+vals[3:]
print("Array elements post deletion: {0}".format(vals))
2. from array import *
arr=array('i',[12,13,14,15,100])
l,r=0,int(len(arr)-1)
while l
1)
from array import *
arr = array('i',[ ])
for i in range(5) :
x = int(input("Enter the value :"))
arr.append(x)
print(arr)
for i in range(5) :
if i == 2 :
continue
print(arr[i],end = " ")
print("
Q2
from math import *
from array import *
arr = array('i', [1, 2, 3, 4, 5])
i = 0
while(i < floor(len(arr)/2)):
arr[i], arr[len(arr) - i - 1] = arr[len(arr) - i - 1], arr[i]
i += 1
print(arr)
I was able to identify the n mistake while u were writing the code.. u r a great teacher❤…
You are awesome and way of teaching is extraordinary..... Thanks
from array import *
arr = array('i', [])
n = int(input("Enter the length of the array"))
for i in range(n):
x = int(input("Enter the next value"))
arr.append(x)
print("Original array elements:", end=" ")
for i in range(n):
print(arr[i], end=" ")
print()
y = int(input("enter element to delete"))
for i in range(n):
if arr[i] == y:
break
pos = i
if pos < n-1:
for j in range(pos,n-1,1):
arr[j] = arr[j+1]
n = n-1
elif pos == n-1:
n = n-1
print("Elements in array after deletion", end=" ")
for k in range(n):
print(arr[k], end=" ")
print()
Hello sir,
you are the best teacher for programming.
Mixed both question 1 & 2
1)from array import*
arr = array('i',[])
n = int(input("What is the length of array"))
for i in range(n):
x =int(input("What is the next value of the array"))
arr.append(x)
print(arr)
val = int(input("what is the value to be searched & deleted"))
k = 0
for e in arr:
if e == val:
print(k)
arr.remove(arr[k])
break
k=k+1
print(arr)
2)arr =arr[::-1]
print(arr)
you are the best sir. Wish you were my professor during college
from array import *
a=array('i',[])
n=int(input("enter size of array"))
for i in range(n):
x=int(input('enter the value'))
a.append(x)
print(a)
x=int(input("enter the index no. by which you want to delete element"))
b=array('i',[])
for i in range(n-1):
if i
for defining typecode and it's input accordingly:
from array import *
types = str(input('enter data type code:'))
a = array(types, [])
length = int(input('enter array length'))
for i in range(length):
if types == 'b' or types == 'B' or types == 'u':
x = str(input('enter elements:'))
a.append(x)
else:
x = int(input('enter elements:'))
a.append(x)
print(a)
for deleting an element in array:
from array import*
list1=[ ]
for i in range(6):
list1.append (int(input("Enter the value for array")))
print (list1)
v=array('i',[ ])
print(array('i',list1))
n=int(input("Enter the value to be removed from the array "))
for a in list1:
if a==n:
continue
v.append(a)
print(v)