Write a program in Python to find the count of negative numbers

Rajnilari2015
Posted by Rajnilari2015 under Python category on | Points: 40 | Views : 147
Given an collection as -8, -7, 6, 0, 7, 1, 6. The objective is to find the count of negative numbers. The below program will do so

from System import *
from System.Collections.Generic import *
from System.Linq import *

class Program(object):
def Main(args):
Console.WriteLine(List[int](-8, -7, 6, 0, 7, 1, 6).TakeWhile().Count())
Console.ReadKey()

Main = staticmethod(Main)

Comments or Responses

Login to post response