April / May 2024
PROBLEM SOLVING AND PYTHON PROGRAMMING
Anna University
1 question papers available. Select an examination session to view its question paper.
PROBLEM SOLVING AND PYTHON PROGRAMMING
Based on available extracted papers. Question groups and frequency are provisional, not official syllabus weightage or examination predictions.
(a) (i) வெவ்வேறு தலைமுறை கணினிகளின் முக்கிய பண்புகள் மற்றும் தொழில்நுட்ப கண்காம்கிப்களைய் பற்றி விவாதிக்கவும். Discuss the main characteristics and technological advancements of the different generations of computers. (ii) கொடுக்கப்பட்ட எண் ஆம்ஸ்ட்ராங் எண்ணாக உள்ளதா என்பதை அறிய அல்காரிதத்தை வடிவமைக்கவும். ஆம்ஸ்ட்ராங் என்பது அதன் சொந்த இலக்கங்களின் கூட்டுத்தொகைக்கு சமமான ஒரு எண்ணாகும், ஒவ்வொன்றும் இலக்கங்களின் எண்ணிக்கையின் சக்இக்கு உயர்த்தப்படுகிறது. உங்கள் அல்காரிதம் பற்றிய தெளிவான, படிப்படியான விளக்கத்தை வழங்கவும். Design an algorithm to determine if a given number is an Armstrong number: An Armstrong is a number that is equal to the sum of its own digits each raised to the power of the number of digits. Provide a clear, step-by-step explanation of your algorithm.
0 eligible source papers(b) (i) பைத்தானில் உள்ள பல்வேறு வகையான ஆபரேட்டர்களை விளக்கி, ஒரு நிரலில் ஒவ்வொரு வகையும் எவ்வாறு பயன்படுத்தப்படுகிறது என்பதற்கான உதாரணத்தை வழங்கவும். Explain the different types of operators in Python and provide an example of how each type is used in a program. (ii) பிட்வைஸ் ஷிப்ட் ஆபரேட்டர்களின் நோக்கம் மற்றும் நடத்தையை விளக்குவதற்கு பைதான் நிரலை எழுதவும். கூடுதலாக, நிரலாக்கத்தில் ஷிப்ட் ஆபரேட்டர்களின் சாத்தியமான பயன்பாடுகளைப் பற்றி விவாதிக்கவும். Write a Python program to demonstrate the purpose and behavior of bitwise shift operators. Additionally, discuss any potential applications of shift operators in programming.
1 eligible source papers(a) (i) பைத்தானில் உள்ள வெவ்வேறு லூப் அறிக்கைகளைப் பற்றி விவாதிக்கவும். வெவ்வேறு பயன்பாடுகளுக்கு ஒவ்வொரு வகை லூப்களின் பொருத்தத்தை எடுத்துக்காட்டும் எடுத்துக்காட்டுகளைக் கொடுங்கள். Discuss the different loop statements in Python. Give examples that highlight the suitability of each type of loops for different applications. 10 (ii) numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] def print_less than_5(): print("Less than 5") for num in numbers: if num < 5: print_less_than_5() continue elif num == break elif num % 2 == print (num) else: continue மேலே உள்ள குறியீடு துணுக்கை பகுப்பாய்வு செய்யவும். வெளியீடு என்னவாக இருக்கும் என்பதை விவரிக்கவும். Analyze the code snippet above. Describe what the output will be.
0 eligible source papers(b) (i) Fibonacci தொடரின் nth எண்ணைக் கண்டறிய ஒரு சுழல்றிலை பைதான் செயல்பாட்டை வடிவமைக்கவும். மறுறிகழ்வு செயல்முறையை விளக்கப்படத்துடன் விளக்கவும். Design a recursive Python function to find the nth term of the Fibonacci series. Explain the recursion procedure with a chart. 10 (ii) x = 10 def my_function(): global x x t= 5 y = 20 print ("Inside function:", x, y) my function () print ("Outside function:", x, y) மேலே உள்ள குறியீடு துணுக்கை பகுப்பாய்வு செய்யவும். வெளியீட்டைக் கணித்து, ‘global’ முக்கிய சொல் x இன் மதஇுப்பை எவ்வாறு பாதிக்கிறது என்பதை விளக்கவும், மற்றும் மாறி இன் நடத்தையைப் பற்றி விவாதிக்கவும். Analyze the code snippet above. Predict the output and explain how the global keyword affects the value of x, and discuss the behavior of variable y.
0 eligible source papers(a) (i) List comprehension என்பதை விளக்குங்கள். String பட்டியலை வடிகட்ட List comprehension பயன்படுத்தி பைதான் நிரலை எழுதவும் மற்றும் மூன்று எழுத்துகளுக்கு மேல் உள்ள String- களை மட்டும் கொண்ட புதிய பட்டியலை உருவாக்கவும். Explain list comprehension. Write a Python program using list comprehension to filter a list of strings and create a new list containing only the strings that have more than three characters. (ii) கொடுக்கப்பட்ட சரம் பாலிண்ட்ரோமா இல்லையா என்பதைச் சரிபார்க்க பைதான் நிரலை எழுதவும். உங்கள் நிரலை உதாரணத்துடன் விளக்குங்கள். Write a Python program to check whether a given string is palindrome or not. Explain your code with an example.
1 eligible source papers(b) (i) பட்டியலில் நகல்களை அகற்ற பைதான் நிரலை எழுதவும். Write a Python program to remove duplicates from a list. (ii) பட்டியல் மற்றும் டூப்ளின் இடையே உள்ள வேறுபாடுகளை எடுத்துக்காட்டுகளுடன் விளக்குங்கள். வெவ்வேறு பயன்பாடுகளுக்கு பட்டியல் மற்றும் டூப்ளின் பொருத்தத்தை விளக்குங்கள். Explain the differences between List and Tuple with examples. Explain the suitability of List and Tuple for different applications.
1 eligible source papers(a) (i) ஏதேனும் 5 செட் செயல்பாடுகளைப் விளக்கவும். List and explain any 5 built-in Set operations with example. (ii) பொருத்தமான எடுத்துக்காட்டுகளுடன் பைத்தானில் உள்ள filter, map, reduce செயல்பாடுகளைக் விளக்கவும். Explain filter, map, reduce operations in Python with suitable examples.
0 eligible source papers(b) (i) பைத்தானில் ஒரு module என்றால் என்ன? அதன் நோக்கம் மற்றும் நிரலை ஒழுங்கமைக்க இது எவ்வாறு உதவுஇறது என்பதை விளக்குங்கள். ஒரு module இறக்குமதி செய்வதற்கான பல்வேறு வழிகளை விளக்குங்கள். What is a module in Python? Explain its purpose and how it helps in organizing code. Explain different ways of importing a module. (ii) கணித தொகுதியை இறக்குமதி செய்ய பைதான் நிரலை எழுதவும் மற்றும் செங்கோண முக்கோணத்தின் இரண்டு குறுகிய பக்கங்களின் நீளத்தை குறிக்கும் அளவுருக்கள் a மற்றும் ௦ எடுக்கும் calculate_hypotenuse செயல்பாட்டை வரையறு. செயல்பாட்டின் உள்ளே, பித்தகோரியன் தேற்றத்தைப் பயன்படுத்தி ஹைபோடென்யூஸின் நீளத்தைக் கணக்கிட்டு இருப்பி அனுப்பவும். Write a Python program that imports the math module and defines a function called calculate_hypotenuse that takes two parameters a and b representing the lengths of the two shorter sides of a right-angled triangle. Inside the function, calculate and return the length of the hypotenuse using the Pythagorean Snmvnon Mbntamtmniinn = Jad (0) 1௮
0 eligible source papers(a) (i) பைத்தானில் கோப்பை இறப்பதற்கான படிகள் என்ன? வெவ்வேறு கோப்பு திறப்பு முறைகளை எடுத்துக்காட்டுடன் விளக்குங்கள். What are the steps in opening a file in Python? Explain the different file opening modes with an example. (ii) உரைக் கோப்பைத் இறக்க பைதான் நிரலை எழுதவும் மற்றும் உள்ளடக்கங்களை மற்றொரு புதிய கோப்பில் நகலெடுக்கவும். Write a Python program to open a text file and copy the contents to another new file.
1 eligible source papers(b) (i) பைத்தானில் பின்வரும் விதிவிலக்கு கையாளுதல் கட்டமைப்பை எடுத்துக்காட்டுகளுடன் விளக்கவும்: try, except, multiple-except, மற்றும் finally. Explain the following exception handling constructs in Python with examples: try, except, multiple-except, and finally. a LOM MIL b ஆஇய இரண்டு எண் மதிப்புகளை உள்ளிடவும், a/b ஐ அச்சிடவும் பயனரைத் தூண்டுவதற்கு பைதான் நிரலை எழுதவும். கொடுக்கப்பட்ட உள்ளீடுகள் முழு எண்களாகவும், வகுத்தல் பூஜ்ஜியமாக இல்லை என்பதை உறுஇப்படுத்தவும் விதிவிலக்கு கையாளுதலைச் செயல்படுத்தவும். Write a Python program that prompts the user to enter two numeric values a and b and prints a/b. Implement exception handling to ensure that the given inputs are integers and the denominator b is not zero.
1 eligible source papers(i) மாணவர்களின் தகவலைக் குறிக்கும் அகராதிகளின் பட்டியல் உங்களுக்கு வழங்கப்பட்டுள்ளது. ஒவ்வொரு அகராஇயிலும் பின்வரும் விசைகள் உள்ளன: 'பெயர்', ‘ 'வயது', 'இரேடு' மற்றும் 'பாடங்கள்'. பின்வரும் பணிகளைச் செய்ய பைதான் நிரலை எழுதவும்: 1. அனைத்து மாணவர்களின் சராசரி வயதைக் கணக்ஒிடுங்கள். 2. அஇக மதிப்பெண் பெற்ற மாணவரைத் தீர்மானித்து அவர்களின் பெயரையும் தரத்தையும் அச்௪டவும். 3. 'கணிதம்' பாடங்களில் ஒன்றாகக் கொண்ட மாணவர்களின் பெயர்களைக் கண்டுபிடூத்து அச்சிடவும். அகராதிகளின் மாதிரி பட்டியல் கழே கொடுக்கப்பட்டுள்ளது. You are given a list of dictionaries representing students’ information. Each dictionary contains the following keys: 'name’, ‘age’, ‘grade’, and 'subjects'. Write a Python program to perform the following tasks: 1. Calculate the average age of all students. 2. Determine the student with the highest grade and print their name and grade. 3. Find and print the names of students who have 'Maths' as one of their subjects. A sample list of dictionaries is given below. students = [ {'name': 'Alice', 'age': 18, 'grade': 'A', "subjects': ['Maths', 'Physics', 'Chemistry']}, {'name': 'Bob', 180௨1: 17, 'grade': 'B', "subjects': ['Maths', 'Biology', 'History']}, ] (ii) கொடுக்கப்பட்ட எண் ‘prime’ எண்ணா இல்லையா என்பதைச் சரிபார்க்க பைதான் நிரலை எழுதவும். கொடுக்கப்பட்ட 'n எண்ணுக்கு உங்கள் நிரலில் உள்ள மாடுலஸ் செயல்பாடு (%) எத்தனை முறை செய்யப்படுகிறது என்பதை பகுப்பாய்வு செய்யவும். Write a Python program to check whether a given number is prime or not. For a given number ‘n’ analyze how many times the modulus operation (%) in your code will be performed.
0 eligible source papersHistorical analysis based on extracted question papers. Topic classifications, marks and planning estimates are provisional.