{"id":8628,"date":"2021-09-30T11:00:53","date_gmt":"2021-09-30T05:30:53","guid":{"rendered":"https:\/\/python-programs.com\/?p=8628"},"modified":"2021-11-22T18:35:30","modified_gmt":"2021-11-22T13:05:30","slug":"python-program-to-print-largest-even-and-largest-odd-number-in-a-list","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-print-largest-even-and-largest-odd-number-in-a-list\/","title":{"rendered":"Python Program to Print Largest Even and Largest Odd Number in a List"},"content":{"rendered":"

Want to excel in java coding? Practice with these Java Programs examples with output<\/a> and write any kind of easy or difficult programs in the java language<\/p>\n

List in Python :<\/strong><\/p>\n

The list data type is one of the most often used data types in Python. The square brackets [ ] easily identify a Python List. Lists are used to store data items, with each item separated by a comma (,). A Python List can include data elements of any data type, including integers and Booleans.<\/p>\n

One of the primary reasons that lists are so popular is that they are mutable. Any data item in a List can be replaced by any other data item if it is mutable. This distinguishes Lists from Tuples, which are likewise used to store data elements but are immutable.<\/p>\n

Given a list, the task is to print the largest Even and Largest Odd number in the given list in Python<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given list =[12, 21, 45, 146, 197, 4]<\/pre>\n

Output:<\/strong><\/p>\n

The Largest even number in the given list [12, 21, 45, 146, 197, 4] = 146\r\nThe Largest odd number in the given list [12, 21, 45, 146, 197, 4] = 197<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given list =  [532, 234, 9273, 845, 1023, 9]<\/pre>\n

Output:<\/strong><\/p>\n

The Largest even number in the given list [532, 234, 9273, 845, 1023, 9] = 532\r\nThe Largest odd number in the given list [532, 234, 9273, 845, 1023, 9] = 9273<\/pre>\n

Program to Print Largest Even and Largest Odd Number in a List in Python<\/h2>\n

Below are the ways to print the largest even element and largest odd element in the given list :<\/p>\n