Skip to content

Instantly share code, notes, and snippets.

View vtu27490-collab's full-sized avatar

vtu27490-collab

  • Joined Oct 16, 2025
View GitHub Profile
@vtu27490-collab
vtu27490-collab / Task5.py
Created October 16, 2025 10:10
Lohith Raj
task 5.a
def find_employee_by_id(employees, target_id):
for employee in employees:
if employee['id'] == target_id:
return employee
return None
# Test the function
employees = [
@vtu27490-collab
vtu27490-collab / Task5.py
Created October 16, 2025 09:49
Lohith Raj
task 5.a
def find_employee_by_id(employees, target_id):
for employee in employees:
if employee['id'] == target_id:
return employee
return None
# Test the function
employees = [
task 4.a
#Add Elements: Add elements to the list.
list=[10,20]
a=30
list.append(a)
print(list)
#Remove Elements: Remove specific elements from the list.
list.pop(1)#by index value
@vtu27490-collab
vtu27490-collab / Task3.py
Created October 16, 2025 09:39
Lohith Raj
task 3.a
# Function to find k'th non repeating character
# in string
from collections import OrderedDict
def kthRepeating(input,k):
# OrderedDict returns a dictionary data structure having characters of input
# string as keys in the same order they were inserted and 0 as their default value
dict=OrderedDict.fromkeys(input,0)
# now traverse input string to calculate frequency of each character
@vtu27490-collab
vtu27490-collab / Task2.py
Last active October 16, 2025 09:45
Lohith Raj
task 2.a
score =int(input("Enter the score:"))
if score>=90:
print("The Grade is A")
elif (score <=89 and score>=80):
@vtu27490-collab
vtu27490-collab / Task1.py
Created October 16, 2025 09:34
Lohith Raj
task 1.a
a = int(input())
print("Loaves Discount")
r=185*a
d=0.6*r