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
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)
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.
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
@@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.
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 :)
#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!
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).
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
# 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)
'''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)
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.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
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)
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)
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 :)
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
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.
Ans 1) from array import* arr=array('i',[]) b=int(input("How many elements do you want?")) for i in range(b): x=int(input("Enter the element")) arr.append(x) c=int(input("Enter the index number you want to delete")) print(arr[0:2]+arr[3:]) Ans 2) from array import* arr=array('i',[]) b=int(input("How many elements do you want?")) for i in range(b): x=int(input("Enter the element")) arr.append(x) print(arr[::-1])
assignment solution 1(remove/delete by index) from array import * arr = array('i',[10,20,30,40,50]) arr2 = array('i', []) print(arr) print() index = int(input('enter index:')) k = 0 for num in arr: if index != k: arr2.append(num) k += 1 print(arr2) -------------------------------------------------------------------- assignment ans 2(reverse) from array import * arr = array('i',[10,20,30,40,50]) arr2 = array('i', []) print(arr) print() index = len(arr) - 1 while index >= 0: arr2.append(arr[index]) index -= 1 print(arr2)
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)
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
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!!
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
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)
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 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])
#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)
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...
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)
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")
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)]
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)
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])
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
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
It can be done without taking the k..as there is a function to get the index of a particular element mylist.index(value) So the simplify code can also be mylist=[10,20,30,40] value=int(input('give the value ')) for i in mylist: if i==value: print(mylist.index(i)) Navin 👍👍👍
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
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("
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
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)
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)
from array import* a=array('i',[]) c=int(input("what index you want to remove")) for i in range(5): b=int(input("enter number")) a.append(b) a.pop(c) print(a)
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) for i in range(int(n/2)): a[i],a[n-1-i]=a[n-1-i],a[i] print("after reversing array is") print(a)
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)
from array import * x = int(input("Please enter the value of how many types do you want to use? ")) arr = array('i', []) for i in range(x): num = int(input("Please enter the next value ")) arr.append(num) print(arr) val = int(input("Please enter the value for search ")) for e in range(len(arr)): if arr[e] == val: print(f"your number is {val} and imdex is {e}") break else: print(f"Your number {val} fot found")
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.
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
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
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.
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)
NaveenBhau, I'm Binge watching your PythON series since this morning. They are quite good. Thanks and Greetings from Switzerland.
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.
# 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
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
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!
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🙏🏻🙏🏻
1.
from array import *
a=array('i',[10,20,30,40])
b=array(a.typecode,[])
i=0
while i
yup this quarantine is python's by Navin sir
by the way, they are amazing
Hi, there are so many channels in youtube for python tutorials, but the way you describe its uniqe and very understable. keep the pace.
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
#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!
Thankyou sir! Your Python tutorials have made my quarantine productive .
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).
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
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?
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
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 ::
I read out the video description and try out the programs or exercises before watching the video. This is an effective method.
# 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❤
The energy with which u explain is commendable. U make learning python fun. Thanks for such tutorials
'''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
from array import *
val =array('i',[1,23,12,44,10,13,4])
i=0
j=len(val)-1
while(i
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
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 :)
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
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
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
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
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
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
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
Ans 1)
from array import*
arr=array('i',[])
b=int(input("How many elements do you want?"))
for i in range(b):
x=int(input("Enter the element"))
arr.append(x)
c=int(input("Enter the index number you want to delete"))
print(arr[0:2]+arr[3:])
Ans 2)
from array import*
arr=array('i',[])
b=int(input("How many elements do you want?"))
for i in range(b):
x=int(input("Enter the element"))
arr.append(x)
print(arr[::-1])
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
assignment solution 1(remove/delete by index)
from array import *
arr = array('i',[10,20,30,40,50])
arr2 = array('i', [])
print(arr)
print()
index = int(input('enter index:'))
k = 0
for num in arr:
if index != k:
arr2.append(num)
k += 1
print(arr2)
--------------------------------------------------------------------
assignment ans 2(reverse)
from array import *
arr = array('i',[10,20,30,40,50])
arr2 = array('i', [])
print(arr)
print()
index = len(arr) - 1
while index >= 0:
arr2.append(arr[index])
index -= 1
print(arr2)
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)
Every one understand firmly ur classes sir.... Good job... 🙏🙏🤝🤝👍👍
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
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
n=int(input("enter a size of array "))
a=array("i",[int(input()) for x in range(n)])
print(a)
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])
Navin, I love learning programming in a funny way :)
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
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.
Best teacher i ever came across in my life lots of love and respect
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
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
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)
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 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])
#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)?
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...
#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])
sir am form non IT background and by watching your videos feel very comfortable in python. Thanks a lot sir.
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)
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")
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
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
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
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
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]
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)
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
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()
Sir the end screens are covering the assignments
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)
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
It can be done without taking the k..as there is a function to get the index of a particular element
mylist.index(value)
So the simplify code can also be
mylist=[10,20,30,40]
value=int(input('give the value '))
for i in mylist:
if i==value:
print(mylist.index(i))
Navin 👍👍👍
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])
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
If only I could heart react your videos like I do on instagram.
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("
One day when I will earn good money, you will get a good donation from me!:)
2. from array import *
arr=array('i',[12,13,14,15,100])
l,r=0,int(len(arr)-1)
while l
Sir your way of teaching is very good i have no words for describing.
love your videos and also loves u alot...
best teacher of all. Couldn't find anyone better. best best best...
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
Thank you very much. You are a genius.
hi sir, i really love the way you teach programming languages. getting inspired from your
teachings
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)
Wow, beautiful explanation sir. The way you are Explaining is in very understandable manner.
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)
from array import*
a=array('i',[])
c=int(input("what index you want to remove"))
for i in range(5):
b=int(input("enter number"))
a.append(b)
a.pop(c)
print(a)
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)
for i in range(int(n/2)):
a[i],a[n-1-i]=a[n-1-i],a[i]
print("after reversing array is")
print(a)
great approach
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)
You have made concepts very simple for beginners, just like in bangalore we have Manjunath Aradhya Sir. Very good, All the best.
1. from array import *
arr=array('i',[12,13,14,15,100])
print(arr)
for i in range(5):
if(i==2):
del arr[i]
print(arr)
I was able to identify the n mistake while u were writing the code.. u r a great teacher❤…
from array import *
x = int(input("Please enter the value of how many types do you want to use? "))
arr = array('i', [])
for i in range(x):
num = int(input("Please enter the next value "))
arr.append(num)
print(arr)
val = int(input("Please enter the value for search "))
for e in range(len(arr)):
if arr[e] == val:
print(f"your number is {val} and imdex is {e}")
break
else:
print(f"Your number {val} fot found")
I have watched many python videos, but your's the best.