46. Problem to create a list of five consecutive numbers.

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
  1. Create a list and use the list comprehension method.
  2. With the help of the range function create a list of five consecutive numbers.
  3. Print the output to see the result.

Output :

Related Articles

Create a sublist of numbers and their squares

Insert a given string at the beginning

Leave a Comment