In this Python list program, we will create a list of five consecutive numbers with the help of the below-given steps.
List of five consecutive numbers:
Steps to solve the program
- Create a list and use the list comprehension method.
- With the help of the range function create a list of five consecutive numbers.
- Print the output to see the result.
Output :
Related Articles
Python program to insert a given string at the beginning of all items in a list.
Python program to iterate over two lists simultaneously and create a list of sublists.
Python program to move all positive numbers on the left side and negative numbers on the right side.
Python program to move all zero digits to the end of a given list of numbers.
Python program to find the list in a list of lists whose sum of elements is the highest.
Python program to find the items that start with a specific character from a given list.