PRACTICAL FILE Fds
PRACTICAL FILE Fds
SESSION: 2024-25
Design a Python program to generate and print a list except for the first 5 elements,
where the values are squares of numbers between 1 and 30.
Source Code:
Output:
EXPERIMENT 3
Source Code:
# Example of a for loop
print("For Loop Example: Squares of numbers from 1 to 5")
for i in range(1, 6):
print(f"The square of {i} is {i**2}")
Output:
EXPERIMENT 4
Source Code:
num1 = 5
num2 = 10
num3 = 8
Source Code:
import random
return story
Output:
EXPERIMENT 6
Create a synthetic dataset (.csv/.xlsx) to work upon and design a python
program to read and print that data.
Source Code:
import csv
# Step 3: Read the dataset from the CSV file and print its content
with open(csv_filename, mode='r') as file:
reader = csv.reader(file)
for row in reader:
print(row)
Output: