#27 Python Tutorial for Beginners | Array values from User in Python | Search in Array

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ม.ค. 2025

ความคิดเห็น • 1.2K

  • @priyanshupatel02
    @priyanshupatel02 4 ปีที่แล้ว +431

    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.

    • @priyanshupatel02
      @priyanshupatel02 4 ปีที่แล้ว +1

      @Prabesh Guragain at the end of the video u can see that...

    • @priyanshupatel02
      @priyanshupatel02 4 ปีที่แล้ว +3

      @Prabesh Guragain in python series video no. #23 at time 7:42 u can see [upper(right side)] assignment

    • @Alexmercer0
      @Alexmercer0 4 ปีที่แล้ว

      how did you removed that playlist??

    • @priyanshupatel02
      @priyanshupatel02 4 ปีที่แล้ว +1

      @@Alexmercer0 i m not removed any Playlist itself.. I m just guessing + and i tried to saw the question little bit. 😋

    • @gogulanbazhakan3987
      @gogulanbazhakan3987 3 ปีที่แล้ว +4

      Yes the video thumbnail recommendation is hiding the assignment questions in most of the videos.

  • @FonxyStar
    @FonxyStar 4 ปีที่แล้ว +178

    the way he says "bye bye " at the end of the video makes me to feel something special....

    • @adamya3565
      @adamya3565 3 ปีที่แล้ว +11

      if this is how you satisfy your need to feel special.. you are definitely in a need of girlfriend bro. :-D

    • @aashishmalhotra
      @aashishmalhotra 3 ปีที่แล้ว

      Lol !!!

    • @HARSH-jj1qj
      @HARSH-jj1qj ปีที่แล้ว

      Are you gay bro 🧐

    • @FonxyStar
      @FonxyStar ปีที่แล้ว

      @@HARSH-jj1qj ask ur dad? Is he gaya or not.
      If yes, u were adopted.

    • @P0latalemdar-627
      @P0latalemdar-627 7 หลายเดือนก่อน

      @@FonxyStar you are LGBTQ

  • @nishantsharma3100
    @nishantsharma3100 5 ปีที่แล้ว +97

    i do competitive coding, whenever i get confused with basic fundamentals , your channel is where i land. thanks bro . 🙌

    • @PawanKumar-ol5sl
      @PawanKumar-ol5sl 3 ปีที่แล้ว +1

      What is competitive coding?

    • @vivekveeraswamyalli7787
      @vivekveeraswamyalli7787 3 ปีที่แล้ว

      what is mean by competitive coding..?

    • @devashishthakkar6723
      @devashishthakkar6723 3 ปีที่แล้ว +4

      @@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.

    • @gourabchakraborty2209
      @gourabchakraborty2209 ปีที่แล้ว

      Hi @nishantsharma3100 , would you suggest a place I can start competitive coding. Let's just say I know python only from Telusko videos

  • @sathishkumars2380
    @sathishkumars2380 4 ปีที่แล้ว +70

    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

    • @gauravbisht9622
      @gauravbisht9622 4 ปีที่แล้ว +5

      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)

    • @harendragoswami5893
      @harendragoswami5893 4 ปีที่แล้ว +8

      Also bro he asked not to use in-built functions

    • @thenoxai
      @thenoxai 4 ปีที่แล้ว +1

      @@gauravbisht9622
      there is a mistake towards the end
      arr.pop(e)

    • @gauravbisht9622
      @gauravbisht9622 4 ปีที่แล้ว +1

      @@thenoxai ahhhh sry maaah bad

    • @AmitGupta-hp1re
      @AmitGupta-hp1re 4 ปีที่แล้ว

      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

  • @ramarashdi2421
    @ramarashdi2421 6 ปีที่แล้ว +30

    You are one of the best teachers for the programming language.
    Go a head.

  • @maimomjhanshirani7426
    @maimomjhanshirani7426 5 ปีที่แล้ว +1

    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)

  • @mrniceguy9653
    @mrniceguy9653 6 ปีที่แล้ว +9

    NaveenBhau, I'm Binge watching your PythON series since this morning. They are quite good. Thanks and Greetings from Switzerland.

  • @avishekmandal6448
    @avishekmandal6448 4 ปีที่แล้ว

    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.

  • @piyushbadule78
    @piyushbadule78 5 ปีที่แล้ว +56

    # Second Program
    from array import *
    arr = array('i',[10,20,30,40,50,60,70,80,90,100])
    print(arr[::-1])

  • @biasnitin
    @biasnitin 5 ปีที่แล้ว +2

    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

  • @abhinavs03
    @abhinavs03 6 ปีที่แล้ว +64

    Hi sir! Just wanted to say your videos are inspiring and to the point. Love them.

    • @sujeetkumarsharma9538
      @sujeetkumarsharma9538 5 ปีที่แล้ว

      really

    • @GAMINGWITHDESTRYER
      @GAMINGWITHDESTRYER 4 ปีที่แล้ว +1

      how to remove End screen

    • @yashjain2370
      @yashjain2370 4 ปีที่แล้ว +3

      @@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.

    • @rachitchhabra9578
      @rachitchhabra9578 4 ปีที่แล้ว

      @@yashjain2370 Thank you!

  • @rohitgoel3194
    @rohitgoel3194 4 ปีที่แล้ว +1

    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 :)

  • @shubhankursharma3323
    @shubhankursharma3323 4 ปีที่แล้ว +3

    Navin sir, I just want to say thank you for this knowledge that you're providing us. Hats off🙏🏻🙏🏻

  • @voiceofheart9873
    @voiceofheart9873 5 ปีที่แล้ว

    1.
    from array import *
    a=array('i',[10,20,30,40])
    b=array(a.typecode,[])
    i=0
    while i

  • @dineshnandyala2727
    @dineshnandyala2727 4 ปีที่แล้ว +15

    yup this quarantine is python's by Navin sir
    by the way, they are amazing

  • @shashanksharma9350
    @shashanksharma9350 4 ปีที่แล้ว +2

    Hi, there are so many channels in youtube for python tutorials, but the way you describe its uniqe and very understable. keep the pace.

  • @vijayroy93
    @vijayroy93 6 ปีที่แล้ว +9

    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

  • @DevOpsWithPankaj
    @DevOpsWithPankaj 4 ปีที่แล้ว +1

    #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!

  • @garimasrivastava4824
    @garimasrivastava4824 4 ปีที่แล้ว +7

    Thankyou sir! Your Python tutorials have made my quarantine productive .

  • @achalpvt8548
    @achalpvt8548 4 ปีที่แล้ว +1

    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"............ ; )

  • @raghuram6382
    @raghuram6382 4 ปีที่แล้ว +5

    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).

  • @yogeshwarprasad6797
    @yogeshwarprasad6797 4 ปีที่แล้ว +1

    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

  • @koyyadashashank7260
    @koyyadashashank7260 3 ปีที่แล้ว +5

    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])

    • @abdulmateen7486
      @abdulmateen7486 10 หลายเดือนก่อน

      How did you learn this code?

  • @Veerendra_virus
    @Veerendra_virus 2 ปีที่แล้ว +1

    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

  • @saipriyareddy762
    @saipriyareddy762 4 ปีที่แล้ว +10

    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])

  • @adamya3565
    @adamya3565 3 ปีที่แล้ว

    I read out the video description and try out the programs or exercises before watching the video. This is an effective method.

  • @ranjithkumarneeruganti4710
    @ranjithkumarneeruganti4710 4 ปีที่แล้ว +8

    # 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)

  • @sultanhussainnajafi5716
    @sultanhussainnajafi5716 ปีที่แล้ว

    I am really really thankful from you. you are the best teacher that I have seen. be successful in whole of your life

  • @Deepaksingh_7_2
    @Deepaksingh_7_2 6 ปีที่แล้ว +6

    the amazing energy you have sir is too good❤

  • @anupamakovid4568
    @anupamakovid4568 4 ปีที่แล้ว +1

    The energy with which u explain is commendable. U make learning python fun. Thanks for such tutorials

  • @thatguyadarsh
    @thatguyadarsh 5 ปีที่แล้ว +33

    '''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
      @noelrakshit 4 ปีที่แล้ว

      Bro, it doesn't remove the value at the index. However, its a good code.

    • @nalinmahajan1337
      @nalinmahajan1337 4 ปีที่แล้ว +8

      @@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)

    • @stockfish3379
      @stockfish3379 4 ปีที่แล้ว

      @@nalinmahajan1337 that was to the point af boi

  • @ramnathan4236
    @ramnathan4236 5 ปีที่แล้ว

    from array import *
    val =array('i',[1,23,12,44,10,13,4])
    i=0
    j=len(val)-1
    while(i

  • @hassnainamjad1059
    @hassnainamjad1059 4 ปีที่แล้ว +56

    i can not see the assignment question on assignment question his playlist and channel logo pops up

    • @Arun_Kumar_x86
      @Arun_Kumar_x86 4 ปีที่แล้ว +1

      yes me too dude , that end screen cards are blocking it .. ! sad

    • @mdc9602
      @mdc9602 4 ปีที่แล้ว +3

      Telusko channel can only disable it!

    • @yogeshjain5907
      @yogeshjain5907 4 ปีที่แล้ว +7

      Pause the video and then slowly slide down the video. You'll now be able to see the assignment question

    • @muneraalkurbi4583
      @muneraalkurbi4583 4 ปีที่แล้ว

      @@yogeshjain5907 what if I'm using a pc :)

    • @rohankumar-si2we
      @rohankumar-si2we 4 ปีที่แล้ว

      Factorial

  • @anilsaini5309
    @anilsaini5309 4 ปีที่แล้ว

    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 :)

  • @yashkothari644
    @yashkothari644 5 ปีที่แล้ว +5

    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)

  • @Dileepkumar-jw4sz
    @Dileepkumar-jw4sz 6 ปีที่แล้ว

    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

  • @moazelsawaf2000
    @moazelsawaf2000 6 ปีที่แล้ว +30

    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)

    • @prathapp2792
      @prathapp2792 3 ปีที่แล้ว +2

      Simply can use ::-1 method

  • @harshvora1922
    @harshvora1922 6 ปีที่แล้ว +1

    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)

  • @soundharyav4634
    @soundharyav4634 3 ปีที่แล้ว +8

    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 :)

  • @yogeshwarprasad6797
    @yogeshwarprasad6797 4 ปีที่แล้ว +2

    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

  • @skjnas
    @skjnas 4 ปีที่แล้ว +35

    Not able to see the assignment question at the end of these videos, It is hidden by Django playlist

    • @leijit8648
      @leijit8648 4 ปีที่แล้ว

      me too

    • @dimitarzortev7199
      @dimitarzortev7199 4 ปีที่แล้ว +14

      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.

    • @djgaming5224
      @djgaming5224 4 ปีที่แล้ว +3

      @@dimitarzortev7199 thanks bro to assignment.

    • @golshanswonderland8906
      @golshanswonderland8906 4 ปีที่แล้ว +1

      @@dimitarzortev7199 Thank you very much!

    • @samrudhraja224
      @samrudhraja224 4 ปีที่แล้ว +1

      @@dimitarzortev7199 Thank you

  • @kunalpansare3504
    @kunalpansare3504 4 ปีที่แล้ว +1

    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])

  • @gameswar5066
    @gameswar5066 5 ปีที่แล้ว +3

    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)

    • @rishabhjain613
      @rishabhjain613 3 ปีที่แล้ว

      you used in built function pop

  • @vishalghuman
    @vishalghuman 4 ปีที่แล้ว +2

    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)

  • @vijaychaurasiya3227
    @vijaychaurasiya3227 6 ปีที่แล้ว +8

    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)

  • @b.sasikumar2141
    @b.sasikumar2141 4 ปีที่แล้ว

    Every one understand firmly ur classes sir.... Good job... 🙏🙏🤝🤝👍👍

  • @nagababuthepython2325
    @nagababuthepython2325 5 ปีที่แล้ว +15

    1). question
    from array import*
    arr=array ('i',[1,2,3,4,5])
    for i in arr:
    if i==arr[2]:
    continue
    print (i)

    • @shubhamshiroya2208
      @shubhamshiroya2208 4 ปีที่แล้ว +1

      if i==arr[2]: means arr[2] represent 3rd number position of the array then skip 3rd number values of array.

    • @The_Mankita
      @The_Mankita 4 ปีที่แล้ว

      Sahi nahi aa raga

  • @balakrishnan9785
    @balakrishnan9785 6 ปีที่แล้ว

    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

  • @pardeepsaini1634
    @pardeepsaini1634 6 ปีที่แล้ว +7

    n=int(input("enter a size of array "))
    a=array("i",[int(input()) for x in range(n)])
    print(a)

  • @alexchristian220
    @alexchristian220 6 ปีที่แล้ว +1

    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])

  • @lkstamenov
    @lkstamenov 5 ปีที่แล้ว +8

    Navin, I love learning programming in a funny way :)

  • @ritakashyap2453
    @ritakashyap2453 4 ปีที่แล้ว

    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!!

    • @rashuagarwal8119
      @rashuagarwal8119 3 ปีที่แล้ว

      you have to make it without using inbuilt function

  • @satyam4122
    @satyam4122 4 ปีที่แล้ว +6

    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.

  • @ibadkhan481
    @ibadkhan481 4 ปีที่แล้ว

    Best teacher i ever came across in my life lots of love and respect

  • @adanufrancis4600
    @adanufrancis4600 5 ปีที่แล้ว +19

    Reverse😁
    from array import*
    arr =array('i', [2, 4 ,56 ,23, 46])
    k= len(arr) - 1
    while k > -1:
    print(arr[k])
    k -= 1

    • @turbosardar39
      @turbosardar39 4 ปีที่แล้ว +1

      Thats not the reverse of an array its only printing in values of an array from last to first...

    • @stockfish3379
      @stockfish3379 4 ปีที่แล้ว

      @@turbosardar39 yeah it's nonsense and other 18 people liked r bigger blockheads

    • @kumarb4336
      @kumarb4336 4 ปีที่แล้ว +2

      @@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

  • @nihalhasan783
    @nihalhasan783 4 ปีที่แล้ว

    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

  • @anooptiwari4098
    @anooptiwari4098 4 ปีที่แล้ว +9

    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

  • @alexchristian220
    @alexchristian220 6 ปีที่แล้ว +1

    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)

  • @vishalmalav1626
    @vishalmalav1626 6 ปีที่แล้ว +3

    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)

  • @BhuveshDhiman
    @BhuveshDhiman 5 ปีที่แล้ว +1

    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])

  • @divyanshutanter6385
    @divyanshutanter6385 5 ปีที่แล้ว +7

    #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)

  • @dheerukuraku5094
    @dheerukuraku5094 4 ปีที่แล้ว

    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...

  • @BoomcoreIsLive
    @BoomcoreIsLive 5 ปีที่แล้ว +21

    #ReversingArray
    from array import *
    arr = array('i',[40,30,20,10,55,77])
    print(arr[::-1])

    • @pikachu6626
      @pikachu6626 5 ปีที่แล้ว

      explain the last line please

    • @BoomcoreIsLive
      @BoomcoreIsLive 5 ปีที่แล้ว +1

      @@pikachu6626 it is slicing... [startValue:endValue:jumpValue]...refer internet about slicing

    • @mirzaebrahimbaig5633
      @mirzaebrahimbaig5633 5 ปีที่แล้ว

      The orignal array is not reversing .this code is just displaying the values in reverse.

    • @mirzaebrahimbaig5633
      @mirzaebrahimbaig5633 5 ปีที่แล้ว +1

      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)

    • @CiceroChen
      @CiceroChen 5 ปีที่แล้ว

      @@mirzaebrahimbaig5633 newArrR = array('i',newArr[::-1])

  • @piushdengani1145
    @piushdengani1145 3 ปีที่แล้ว

    sir am form non IT background and by watching your videos feel very comfortable in python. Thanks a lot sir.

  • @aarushjadge31
    @aarushjadge31 5 ปีที่แล้ว +26

    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

    • @Anonymousss07
      @Anonymousss07 4 ปีที่แล้ว +1

      thats a wrong code bro u have given a string in the print it prints navin only...lol

    • @giridharsriram9404
      @giridharsriram9404 4 ปีที่แล้ว

      @@Anonymousss07 i think it wont print anything brother because he didnt defined mybad

    • @saijyothi2903
      @saijyothi2903 4 ปีที่แล้ว

      U'll get an error coz.. string must be place in single quotes

  • @nihalhasan783
    @nihalhasan783 4 ปีที่แล้ว

    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")

  • @RahulGupta-ly2uu
    @RahulGupta-ly2uu 6 ปีที่แล้ว +9

    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])
    >>>

    • @chandinisaleem692
      @chandinisaleem692 6 ปีที่แล้ว

      Hi.. can you please explain how the second query works..??

    • @premkiran6591
      @premkiran6591 6 ปีที่แล้ว

      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)]

    • @premkiran6591
      @premkiran6591 6 ปีที่แล้ว

      sry it is
      arr[e],arr[n-e-1]=arr[n-e-1],arr[e]

    • @sagnikray5391
      @sagnikray5391 5 ปีที่แล้ว

      you have to pop the value at index no.2

  • @govoorsaiteja8552
    @govoorsaiteja8552 5 ปีที่แล้ว +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)

    • @atharvaborikar6125
      @atharvaborikar6125 3 ปีที่แล้ว

      u have to write it without using built in functions

  • @erinfolamiquadri3406
    @erinfolamiquadri3406 5 ปีที่แล้ว +5

    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])

    • @nabilarehman3274
      @nabilarehman3274 3 ปีที่แล้ว

      thank you. it was a simple code and got me so confused

  • @omsahareofficial5637
    @omsahareofficial5637 4 ปีที่แล้ว +1

    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

  • @adityasaxena6619
    @adityasaxena6619 5 ปีที่แล้ว +3

    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

    • @AshishKumar-rz7ul
      @AshishKumar-rz7ul 4 ปีที่แล้ว

      after wards just use del arry[len(arry)-1]

  • @matthewmorrison2071
    @matthewmorrison2071 3 ปีที่แล้ว

    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)

  • @adityachand1750
    @adityachand1750 5 ปีที่แล้ว +28

    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

    • @seemapassi6550
      @seemapassi6550 5 ปีที่แล้ว +1

      Aditya Chand
      that's ok but can you write in the array form

    • @karthikjonnala5837
      @karthikjonnala5837 5 ปีที่แล้ว +2

      @@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])

    • @growthforyou6900
      @growthforyou6900 4 ปีที่แล้ว

      @@karthikjonnala5837 error its append not apend

    • @bhagatg1917
      @bhagatg1917 4 ปีที่แล้ว

      @@karthikjonnala5837 thanx bro

    • @balasaasthab4044
      @balasaasthab4044 7 หลายเดือนก่อน

      Wow nice thinking

  • @sayanpoddar6595
    @sayanpoddar6595 4 ปีที่แล้ว +1

    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()

  • @samrudhraja224
    @samrudhraja224 4 ปีที่แล้ว +4

    Sir the end screens are covering the assignments

  • @antonypaul7579
    @antonypaul7579 5 ปีที่แล้ว

    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)

  • @anjaligarg3807
    @anjaligarg3807 4 ปีที่แล้ว +6

    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.

    • @mahmouddaragmeh5198
      @mahmouddaragmeh5198 4 ปีที่แล้ว +4

      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

    • @kusumanjali_akula
      @kusumanjali_akula 4 ปีที่แล้ว +1

      @@mahmouddaragmeh5198 thanks

    • @BIT_HIMANIGulati
      @BIT_HIMANIGulati 4 ปีที่แล้ว +1

      @@mahmouddaragmeh5198 thanx

    • @lucasdominichini3095
      @lucasdominichini3095 4 ปีที่แล้ว

      @@mahmouddaragmeh5198 thx

  • @loku824
    @loku824 5 ปีที่แล้ว

    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 👍👍👍

  • @onkkkar
    @onkkkar 5 ปีที่แล้ว +9

    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])

  • @anupburnwal9255
    @anupburnwal9255 5 ปีที่แล้ว

    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

  • @shabalbaig9544
    @shabalbaig9544 5 ปีที่แล้ว +3

    If only I could heart react your videos like I do on instagram.

  • @adnanpasha948
    @adnanpasha948 4 ปีที่แล้ว

    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("

  • @klibsha6565
    @klibsha6565 5 ปีที่แล้ว +4

    One day when I will earn good money, you will get a good donation from me!:)

  • @Rocky26rocky
    @Rocky26rocky 4 ปีที่แล้ว +1

    2. from array import *
    arr=array('i',[12,13,14,15,100])
    l,r=0,int(len(arr)-1)
    while l

  • @tufailkhan8803
    @tufailkhan8803 5 ปีที่แล้ว +2

    Sir your way of teaching is very good i have no words for describing.
    love your videos and also loves u alot...

  • @nafisanahar3413
    @nafisanahar3413 6 ปีที่แล้ว

    best teacher of all. Couldn't find anyone better. best best best...

  • @vishalvikas9472
    @vishalvikas9472 4 ปีที่แล้ว +1

    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

  • @vakhariyajay2224
    @vakhariyajay2224 2 ปีที่แล้ว +1

    Thank you very much. You are a genius.

  • @vishnuchaithanya6146
    @vishnuchaithanya6146 6 ปีที่แล้ว +2

    hi sir, i really love the way you teach programming languages. getting inspired from your
    teachings

  • @lohithn3473
    @lohithn3473 5 ปีที่แล้ว +1

    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)

  • @subbubhat7805
    @subbubhat7805 4 ปีที่แล้ว

    Wow, beautiful explanation sir. The way you are Explaining is in very understandable manner.

  • @chhavimanichoubey9437
    @chhavimanichoubey9437 5 ปีที่แล้ว

    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)

  • @adamhawk4884
    @adamhawk4884 4 ปีที่แล้ว

    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)

  • @anupburnwal9255
    @anupburnwal9255 5 ปีที่แล้ว +1

    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)

  • @nalinmahajan1337
    @nalinmahajan1337 4 ปีที่แล้ว +1

    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)

  • @shreyasdevang
    @shreyasdevang 6 ปีที่แล้ว

    You have made concepts very simple for beginners, just like in bangalore we have Manjunath Aradhya Sir. Very good, All the best.

  • @Rocky26rocky
    @Rocky26rocky 4 ปีที่แล้ว +1

    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)

  • @042rehansiddique4
    @042rehansiddique4 7 หลายเดือนก่อน

    I was able to identify the n mistake while u were writing the code.. u r a great teacher❤…

  • @ZakirHossain-nq8jp
    @ZakirHossain-nq8jp 3 หลายเดือนก่อน

    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")

  • @FreeTechCafe
    @FreeTechCafe 6 ปีที่แล้ว

    I have watched many python videos, but your's the best.