References
1. Tkinter Documentation:
Python’s official documentation on Tkinter provides detailed information on creating
graphical user interfaces with the library.
[Link]
2. Python strftime Method:
Official Python documentation for formatting date and time strings using the strftime
method.
[Link]
3. Python Tkinter - Tutorial:
A comprehensive tutorial for building GUIs with Python's Tkinter library.
[Link]
4. Stack Overflow:
A community-driven resource for solutions to common coding problems and discussions.
Various answers regarding Tkinter and timer functionality can be found here.
[Link]
ChhapaakA small industry has constraints on workspace availability across different months of
the year. Employees with names containing an even number of characters will work remotely
during the months of January, February, and March, while they work in the office during the
months of April, May, and June. On the other hand, employees with names containing an odd
number of characters will work remotely during the months of July, August, and September and in
the office during October, November, and December. Write a Python code to display each
employee's work schedule based on the month.
# List of employee names
employees = ["Alice", "Bob", "Charlie", "David", "Eve", "Frank", "Grace"]
# Define remote and office months
remote_months_even = ["January", "February", "March"]
office_months_even = ["April", "May", "June"]
remote_months_odd = ["July", "August", "September"]
office_months_odd = ["October", "November", "December"]
# Initialize an empty list to store schedules
work_schedule = []
# Iterate through each employee and assign work schedule based on name length
for employee in employees:
if len(employee) % 2 == 0:
# Even character count - remote work Jan-Mar
schedule = f"{employee}: Remote Work - {', '.join(remote_months_even)} | Office Work - {',
'.join(office_months_even)}"
else:
# Odd character count - remote work Jul-Sep
schedule = f"{employee}: Remote Work - {', '.join(remote_months_odd)} | Office Work - {', '.join(office_months_odd)}"
# Append each employee's schedule to the list
work_schedule.append(schedule)
# Print each schedule in the list
for entry in work_schedule:
print(entry)
There is a technical event in a college for which student volunteers are needed. The number of
applications received for the volunteers is huge, and hence the committee decides to filter them
out. It plans to select those students whose names have more than 5 characters. Write a Python
program for this scenario using an appropriate data structure and print the required output by
taking the user input.
# Get a list of student names as input from the user
students = input("Enter the names of students, separated by commas: ").split(',')
# Filter students based on the condition (length > 5 characters)
selected_students = [[Link]() for name in students if len([Link]()) > 5]
# Print the selected students
print("Selected students whose names have more than 5 characters:")
for student in selected_students:
print(student)
Write a python program for counting number of consonants in a string
What is for loop, its syntax and range function and its example.
Write a python program using all the airthmatic operators
Write a program to generate a table of number (3*) by excluding 33 and 42 from range of 3 to 60 and by entering -1 the
program should terminate.
Code snippets will be given based on loops and strings. Find out the outputs and errors if it is there and justify them.
In a given String “Never Give Up”, use all the string methods to get the function useful for the string.
Out of 4 lab programs any one will come. (And for distance between two points both answers are accepted using import
math and other but should be the right one.)