896+ Capstone Project is Available: Whatsapp: +91-7011258995, Email: sharecodepoint@gmail.com

How do I take 'N' number of an input array in Python?

How do I take 'N' number of an input array in Python?
This very easy and simple example of a list in Python:
studentname = []
print('List is empty :(')
option = str(input('You want add the element in the list (yes/no)? : '))
if option == 'yes':
    num = int(input('How much element you want : '))
    for i in range(1, num+1):
        print('Enter the', i, 'student name: ')
        n = str(input())
        studentname.append(n)
else:
    print('Thank you for using sharecodepoint services !!')
print('\n', studentname)

Sharecodepoint

Sharecodepoint is the junction where every essential thing is shared for college students in the well-defined packets of codes. We are focused on providing you the best material package like Question papers, MCQ'S, and one NIGHT STUDY MATERIAL. facebook twitter youtube instagram

Post a Comment

Previous Post Next Post

Contact Form