Tax Eligibility Check
Take income and age, and check if eligible for tax (age > 18 and income > 5 L).
IntermediatePhase 1 - Level 4: Logical Operators & Compound StatementsExample 5 of 10
tax-eligibility-check.py
1# Take income and age2income = float(input("Enter income (in lakhs): "))3age = int(input("Enter age: "))45# Check tax eligibility6if age > 18 and income > 5:7 print("Eligible for tax")8else:9 print("Not eligible for tax")
Output
Enter income (in lakhs): 6 Enter age: 25 Eligible for tax Enter income (in lakhs): 4 Enter age: 25 Not eligible for tax
What's going on
Use AND to check both conditions.
Key Concepts:
Age must be > 18
Income must be > 5 lakhs
Both conditions must be true
🔗Related Content
- 📖
Phase 1 - Learn Concepts
Review Phase 1 concepts and explanations
- 📝
Phase 1 - Quiz
Test your Phase 1 understanding with quiz questions
- 💻
Phase 1 - All Practice Problems
Explore all practice problems for Phase 1
- 🎓
Master Your Logic Building - Complete Course
Browse all phases and tutorials
- 🧠
Logic Building Overview
Learn about the complete logic building curriculum