Monday, March 4, 2019

Positive and Negative Number Lister Using Two Dimensional List in Python


Write a program that will ask the user how many values to be processed. The program also will ask the user to give a series of grade values using the two-dimensional list and check which of the given number is positive or negative in terms of numerical value and display the result on the screen.

 I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting.

work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental Philippines is  +63 (034) 4335675.

Here in Bacolod I also accepting computer repair, networking and Arduino Project development at a very affordable price.

My personal website is http://www.jakerpomperada.com


Sample Program Output


Program Listing


# positive_negative.py
# Jake R. Pomperada
# March 4, 2019   Monday
# Bacolod City, Negros Occidental
print();
print("\tPositive and Negative Number Lister Using Two Dimensional List");
print();
num = int(input('\tHow many numbers: '))
print();
accept = []
for a in range(0,num):   #row
    accept.append([])
for b in range(0,num) : # row
    for c in range(0,1) : # column
        accept[b].append(c);
        accept[b][c]=0;

for b in range(0,num) : # row
    for c in range(0,1) : # column
         accept[b][c]=int(input("\tGive value in item no. {0} : ".format(b+1)));

print();
print("\tDisplay Result")
print();
print("\tList of Positive Number");
print();
for i in range(len(accept)):
    for j in range(len(accept[i])):
        if accept[i][j] >= 0:
         print("\t",accept[i][j], end=" ")
print("\n");
print("\tList of Negative Number");
print();
for i in range(len(accept)):
    for j in range(len(accept[i])):
        if accept[i][j] < 0:
         print("\t",accept[i][j], end=" ")
print("\n");
print("\tEND OF PROGRAM")

No comments:

Post a Comment