Skip to content

yesrkaya/python-random-integer-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Generate and Process Random Integers in Python

This repository contains a Python script that performs the following tasks:

  1. Generates a list of random integers within the range [1, 5].
  2. Multiplies each integer in the list by 4 to create a new list.
  3. Filters the new list to include only the elements that are greater than 10.
  4. Calculates and prints the sum of the filtered elements.

Getting Started

Prerequisites

  • Python 3.x

Running the Script

  1. Clone the repository:
    git clone https://github.com/yesrkaya/python-random-integer-processing.git
  2. Navigate to the repository directory:
    cd python-random-integer-processing
  3. Run the script:
    python data-lab1.py

Script Description

The script prompts the user to enter the number of elements (n). It then generates n random integers within the range [1, 5], multiplies each integer by 4, filters the resulting list to include only elements greater than 10, and finally calculates and prints the sum of these elements.

Example Output

Enter the number of elements (n): 5
Initial list: [3, 1, 4, 2, 5]
List after multiplying by 4: [12, 4, 16, 8, 20]
Sum of elements greater than 10: 48

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages