■ Week Test - Answer Sheet
■ Python Programming Test
Q1. Vowels in string → Output: 5
Q2. Sum of first 10 natural numbers → Output: 55
Q3. Reverse string 'PYTHON' → Output: NOHTYP
Q4. Prime check for 7 → Output: Prime
Q5. Celsius (25°C) to Fahrenheit → Output: 77.0
Q6. Swap numbers (a=5, b=10) → Output: 10 5
Q7. Factorial of 5 → Output: 120
Q8. Calculator (a=8, b=2): Sum=10, Sub=6, Mul=16, Div=4.0
Q9. First 5 Fibonacci terms → Output: 0 1 1 2 3
Q10. Maximum number in list [1..10] → Output: 10
■ Python Programming & NLP Test
Part A – Python Basics
Q1. Python is popular for AI → Simple, libraries, community support.
Q2. Portable → Runs on any OS without changes.
Q3. print(5 + 3) → 8
Q4. print(5 + 3 * 2) → 11
Q5. IDEs: PyCharm, Jupyter Notebook (also VS Code, IDLE).
Part B – NLP Basics
Q6. Purpose of NLP → Understand/respond in human language (e.g., Alexa).
Q7. NLU = Understand meaning (lost parcel); NLG = Generate response (Please share ID).
Q8. Tokenization → 'I love AI' → ['I', 'love', 'AI'].
Q9. Stemming: playing, played → play. Lemmatization: running, ran → run.
Q10. Speech → (Speech Recognition) → Text → (NLU) → Understanding → (NLG) → Text →
(Text-to-Speech) → Machine Speech.