โ๏ธ Python Practice Arena
Move from Python foundations to placement-level problem solving through 12 progressive levels. Every challenge uses the CodeBhavya story format, a complete problem contract and the appropriate browser or local practice mode.
๐ฏ Choose Your Practice Level
Start with Level 1 and move step by step, or jump directly to the Python topic you want to practise.
Beginner Practice
Build confidence with syntax, output and the basic Python workflow.
Python Foundations
Syntax, comments, output and small beginner programs.
Open Level โData Types & I/O
Variables, conversion, formatted input and output.
Open Level โOperators & Expressions
Arithmetic, precedence, comparison, logic and bitwise work.
Open Level โDecision Making
Conditions, chained decisions and boundary handling.
Open Level โIntermediate Practice
Strengthen loops, text and collection-based problem solving.
Loops & Patterns
Iteration, accumulators, digit logic and visual patterns.
Open Level โStrings
Traversal, slicing, normalisation and text analysis.
Open Level โLists, Tuples & Sets
Sequence processing, uniqueness and set operations.
Open Level โDictionaries
Counting, lookup, grouping and record processing.
Open Level โAdvanced Practice
Apply modular design, files and object-oriented thinking.
Functions & Recursion
Reusable functions, recursion and structured decomposition.
Open Level โModules, Exceptions & Files
Twenty genuine local labs for persistent data workflows.
Open Level โObject-Oriented Python
Classes, inheritance, encapsulation and polymorphism.
Open Level โPlacement Practice
Finish with interview-style Python coding challenges.
๐งฉ Open a Level & Start Solving
Each level contains 20 compact challenge cards. Open a challenge to see its story, task, input/output contract, constraints, examples, concepts and practice workspace.
Level 1 โ Python FoundationsSyntax, comments, output and small beginner programs. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Welcome Message
Core Skill: print() and String Literals
View Challenge โ
Orientation Desk โ Welcome Message
Orientation Desk needs a reliable Python utility. Display the required welcome message exactly as shown.
๐ฏ Your Task
Display the required welcome message exactly as shown.
๐ฅ Input Format
No runtime input is required.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Do not add quotation marks or extra spaces to the output.
No input
Hello Python
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
print("Hello Python")CHALLENGE 02 EasyCampus Portal โ Learner Profile Card
Core Skill: input() and Labelled Output
View Challenge โ
Campus Portal โ Learner Profile Card
Campus Portal needs a reliable Python utility. Read a learner name, course and goal on separate lines, then display a labelled three-line profile.
๐ฏ Your Task
Read a learner name, course and goal on separate lines, then display a labelled three-line profile.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each input value is a non-empty line of at most 40 characters.
Asha Python Placement
Name: Asha Course: Python Goal: Placement
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
name = input()
course = input()
goal = input()
print("Name:", name)
print("Course:", course)
print("Goal:", goal)CHALLENGE 03 EasyLearning Studio โ Sum and Product Board
Core Skill: Variables and Arithmetic
View Challenge โ
Learning Studio โ Sum and Product Board
Learning Studio needs a reliable Python utility. Read two integers and display their sum and product on labelled lines.
๐ฏ Your Task
Read two integers and display their sum and product on labelled lines.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-10000 โค each integer โค 10000.
5 7
Sum = 12 Product = 35
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
print("Sum =", first + second)
print("Product =", first * second)CHALLENGE 04 EasySkill Tracker โ Three-Line Learning Flow
Core Skill: Newlines and Multiple Output Lines
View Challenge โ
Skill Tracker โ Three-Line Learning Flow
Skill Tracker needs a reliable Python utility. Display the three required learning actions, one action per line.
๐ฏ Your Task
Display the three required learning actions, one action per line.
๐ฅ Input Format
No runtime input is required.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Preserve the order and capitalisation shown.
No input
Learn Practice Build
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
print("Learn")
print("Practice")
print("Build")CHALLENGE 05 EasyMentor Console โ Value Swap
Core Skill: Assignment and Temporary Variables
View Challenge โ
Mentor Console โ Value Swap
Mentor Console needs a reliable Python utility. Read two words and print them in swapped order on one line.
๐ฏ Your Task
Read two words and print them in swapped order on one line.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each value is one word without spaces.
red blue
blue red
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = input()
second = input()
first, second = second, first
print(first, second)CHALLENGE 06 EasyLibrary Counter โ Welcome Message
Core Skill: print() and String Literals
View Challenge โ
Library Counter โ Welcome Message
Library Counter needs a reliable Python utility. Display the required welcome message exactly as shown.
๐ฏ Your Task
Display the required welcome message exactly as shown.
๐ฅ Input Format
No runtime input is required.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Do not add quotation marks or extra spaces to the output.
No input
CodeBhavya
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
print("CodeBhavya")CHALLENGE 07 EasyPractice Lab โ Learner Profile Card
Core Skill: input() and Labelled Output
View Challenge โ
Practice Lab โ Learner Profile Card
Practice Lab needs a reliable Python utility. Read a learner name, course and goal on separate lines, then display a labelled three-line profile.
๐ฏ Your Task
Read a learner name, course and goal on separate lines, then display a labelled three-line profile.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each input value is a non-empty line of at most 40 characters.
Ravi Python Projects
Name: Ravi Course: Python Goal: Projects
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
name = input()
course = input()
goal = input()
print("Name:", name)
print("Course:", course)
print("Goal:", goal)CHALLENGE 08 EasyQuiz Engine โ Sum and Product Board
Core Skill: Variables and Arithmetic
View Challenge โ
Quiz Engine โ Sum and Product Board
Quiz Engine needs a reliable Python utility. Read two integers and display their sum and product on labelled lines.
๐ฏ Your Task
Read two integers and display their sum and product on labelled lines.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-10000 โค each integer โค 10000.
8 4
Sum = 12 Product = 32
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
print("Sum =", first + second)
print("Product =", first * second)CHALLENGE 09 EasyProject Hub โ Three-Line Learning Flow
Core Skill: Newlines and Multiple Output Lines
View Challenge โ
Project Hub โ Three-Line Learning Flow
Project Hub needs a reliable Python utility. Display the three required learning actions, one action per line.
๐ฏ Your Task
Display the three required learning actions, one action per line.
๐ฅ Input Format
No runtime input is required.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Preserve the order and capitalisation shown.
No input
Think Code Test
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
print("Think")
print("Code")
print("Test")CHALLENGE 10 EasyPlacement Desk โ Value Swap
Core Skill: Assignment and Temporary Variables
View Challenge โ
Placement Desk โ Value Swap
Placement Desk needs a reliable Python utility. Read two words and print them in swapped order on one line.
๐ฏ Your Task
Read two words and print them in swapped order on one line.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each value is one word without spaces.
left right
right left
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = input()
second = input()
first, second = second, first
print(first, second)CHALLENGE 11 EasyTeam Dashboard โ Welcome Message
Core Skill: print() and String Literals
View Challenge โ
Team Dashboard โ Welcome Message
Team Dashboard needs a reliable Python utility. Display the required welcome message exactly as shown.
๐ฏ Your Task
Display the required welcome message exactly as shown.
๐ฅ Input Format
No runtime input is required.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Do not add quotation marks or extra spaces to the output.
No input
Learn Practice Build
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
print("Learn Practice Build")CHALLENGE 12 EasyData Centre โ Learner Profile Card
Core Skill: input() and Labelled Output
View Challenge โ
Data Centre โ Learner Profile Card
Data Centre needs a reliable Python utility. Read a learner name, course and goal on separate lines, then display a labelled three-line profile.
๐ฏ Your Task
Read a learner name, course and goal on separate lines, then display a labelled three-line profile.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each input value is a non-empty line of at most 40 characters.
Meera Python Interview
Name: Meera Course: Python Goal: Interview
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
name = input()
course = input()
goal = input()
print("Name:", name)
print("Course:", course)
print("Goal:", goal)CHALLENGE 13 MediumStudent Vault โ Sum and Product Board
Core Skill: Variables and Arithmetic
View Challenge โ
Student Vault โ Sum and Product Board
Student Vault needs a reliable Python utility. Read two integers and display their sum and product on labelled lines.
๐ฏ Your Task
Read two integers and display their sum and product on labelled lines.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-10000 โค each integer โค 10000.
12 3
Sum = 15 Product = 36
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
print("Sum =", first + second)
print("Product =", first * second)CHALLENGE 14 MediumWorkshop Board โ Three-Line Learning Flow
Core Skill: Newlines and Multiple Output Lines
View Challenge โ
Workshop Board โ Three-Line Learning Flow
Workshop Board needs a reliable Python utility. Display the three required learning actions, one action per line.
๐ฏ Your Task
Display the three required learning actions, one action per line.
๐ฅ Input Format
No runtime input is required.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Preserve the order and capitalisation shown.
No input
Read Trace Run
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
print("Read")
print("Trace")
print("Run")CHALLENGE 15 MediumCareer Console โ Value Swap
Core Skill: Assignment and Temporary Variables
View Challenge โ
Career Console โ Value Swap
Career Console needs a reliable Python utility. Read two words and print them in swapped order on one line.
๐ฏ Your Task
Read two words and print them in swapped order on one line.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each value is one word without spaces.
first second
second first
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = input()
second = input()
first, second = second, first
print(first, second)CHALLENGE 16 MediumResearch Desk โ Welcome Message
Core Skill: print() and String Literals
View Challenge โ
Research Desk โ Welcome Message
Research Desk needs a reliable Python utility. Display the required welcome message exactly as shown.
๐ฏ Your Task
Display the required welcome message exactly as shown.
๐ฅ Input Format
No runtime input is required.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Do not add quotation marks or extra spaces to the output.
No input
Python Ready
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
print("Python Ready")CHALLENGE 17 MediumChallenge Arena โ Learner Profile Card
Core Skill: input() and Labelled Output
View Challenge โ
Challenge Arena โ Learner Profile Card
Challenge Arena needs a reliable Python utility. Read a learner name, course and goal on separate lines, then display a labelled three-line profile.
๐ฏ Your Task
Read a learner name, course and goal on separate lines, then display a labelled three-line profile.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each input value is a non-empty line of at most 40 characters.
Kiran Python Automation
Name: Kiran Course: Python Goal: Automation
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
name = input()
course = input()
goal = input()
print("Name:", name)
print("Course:", course)
print("Goal:", goal)CHALLENGE 18 MediumRevision Room โ Sum and Product Board
Core Skill: Variables and Arithmetic
View Challenge โ
Revision Room โ Sum and Product Board
Revision Room needs a reliable Python utility. Read two integers and display their sum and product on labelled lines.
๐ฏ Your Task
Read two integers and display their sum and product on labelled lines.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-10000 โค each integer โค 10000.
9 11
Sum = 20 Product = 99
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
print("Sum =", first + second)
print("Product =", first * second)CHALLENGE 19 MediumInterview Lab โ Three-Line Learning Flow
Core Skill: Newlines and Multiple Output Lines
View Challenge โ
Interview Lab โ Three-Line Learning Flow
Interview Lab needs a reliable Python utility. Display the three required learning actions, one action per line.
๐ฏ Your Task
Display the three required learning actions, one action per line.
๐ฅ Input Format
No runtime input is required.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Preserve the order and capitalisation shown.
No input
Plan Build Grow
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
print("Plan")
print("Build")
print("Grow")CHALLENGE 20 MediumCodeBhavya Hub โ Value Swap
Core Skill: Assignment and Temporary Variables
View Challenge โ
CodeBhavya Hub โ Value Swap
CodeBhavya Hub needs a reliable Python utility. Read two words and print them in swapped order on one line.
๐ฏ Your Task
Read two words and print them in swapped order on one line.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each value is one word without spaces.
learn build
build learn
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = input()
second = input()
first, second = second, first
print(first, second)Level 2 โ Data Types & I/OVariables, conversion, formatted input and output. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Marks Summary
Core Skill: Integer Conversion and Average
View Challenge โ
Orientation Desk โ Marks Summary
Orientation Desk needs a reliable Python utility. Read three integer marks, then display their total and average rounded to two decimal places.
๐ฏ Your Task
Read three integer marks, then display their total and average rounded to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค every mark โค 100.
75 82 91
Total = 248 Average = 82.67
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
third = int(input())
total = first + second + third
print("Total =", total)
print(f"Average = {total / 3:.2f}")CHALLENGE 02 EasyCampus Portal โ Temperature Converter
Core Skill: Floating-Point Conversion
View Challenge โ
Campus Portal โ Temperature Converter
Campus Portal needs a reliable Python utility. Read a Celsius temperature and display its Fahrenheit value rounded to two decimal places.
๐ฏ Your Task
Read a Celsius temperature and display its Fahrenheit value rounded to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-273.15 โค Celsius โค 10000.
25
Fahrenheit = 77.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
celsius = float(input())
fahrenheit = celsius * 9 / 5 + 32
print(f"Fahrenheit = {fahrenheit:.2f}")CHALLENGE 03 EasyLearning Studio โ Distance Converter
Core Skill: Numeric Types and Units
View Challenge โ
Learning Studio โ Distance Converter
Learning Studio needs a reliable Python utility. Read a distance in kilometres and display metres and centimetres, both to two decimal places.
๐ฏ Your Task
Read a distance in kilometres and display metres and centimetres, both to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค distance โค 100000.
2.5
Metres = 2500.00 Centimetres = 250000.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
kilometres = float(input())
print(f"Metres = {kilometres * 1000:.2f}")
print(f"Centimetres = {kilometres * 100000:.2f}")CHALLENGE 04 EasySkill Tracker โ Discount Bill
Core Skill: Formatted Financial Output
View Challenge โ
Skill Tracker โ Discount Bill
Skill Tracker needs a reliable Python utility. Read quantity, unit price and discount percentage, then print the final bill to two decimal places.
๐ฏ Your Task
Read quantity, unit price and discount percentage, then print the final bill to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Quantity is positive; price and discount are non-negative; discount โค 100.
5 100 10
Final Bill = 450.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
quantity = int(input())
price = float(input())
discount = float(input())
final_bill = quantity * price * (1 - discount / 100)
print(f"Final Bill = {final_bill:.2f}")CHALLENGE 05 EasyMentor Console โ Formatted Student Record
Core Skill: f-Strings and Type Conversion
View Challenge โ
Mentor Console โ Formatted Student Record
Mentor Console needs a reliable Python utility. Read a name, age and score, then print one precisely formatted student record.
๐ฏ Your Task
Read a name, age and score, then print one precisely formatted student record.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Name is one non-empty line; 1 โค age โค 120; 0 โค score โค 100.
Asha 19 91.5
Name: Asha | Age: 19 | Score: 91.50
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
name = input()
age = int(input())
score = float(input())
print(f"Name: {name} | Age: {age} | Score: {score:.2f}")CHALLENGE 06 EasyLibrary Counter โ Marks Summary
Core Skill: Integer Conversion and Average
View Challenge โ
Library Counter โ Marks Summary
Library Counter needs a reliable Python utility. Read three integer marks, then display their total and average rounded to two decimal places.
๐ฏ Your Task
Read three integer marks, then display their total and average rounded to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค every mark โค 100.
60 70 80
Total = 210 Average = 70.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
third = int(input())
total = first + second + third
print("Total =", total)
print(f"Average = {total / 3:.2f}")CHALLENGE 07 EasyPractice Lab โ Temperature Converter
Core Skill: Floating-Point Conversion
View Challenge โ
Practice Lab โ Temperature Converter
Practice Lab needs a reliable Python utility. Read a Celsius temperature and display its Fahrenheit value rounded to two decimal places.
๐ฏ Your Task
Read a Celsius temperature and display its Fahrenheit value rounded to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-273.15 โค Celsius โค 10000.
0
Fahrenheit = 32.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
celsius = float(input())
fahrenheit = celsius * 9 / 5 + 32
print(f"Fahrenheit = {fahrenheit:.2f}")CHALLENGE 08 EasyQuiz Engine โ Distance Converter
Core Skill: Numeric Types and Units
View Challenge โ
Quiz Engine โ Distance Converter
Quiz Engine needs a reliable Python utility. Read a distance in kilometres and display metres and centimetres, both to two decimal places.
๐ฏ Your Task
Read a distance in kilometres and display metres and centimetres, both to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค distance โค 100000.
1.2
Metres = 1200.00 Centimetres = 120000.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
kilometres = float(input())
print(f"Metres = {kilometres * 1000:.2f}")
print(f"Centimetres = {kilometres * 100000:.2f}")CHALLENGE 09 EasyProject Hub โ Discount Bill
Core Skill: Formatted Financial Output
View Challenge โ
Project Hub โ Discount Bill
Project Hub needs a reliable Python utility. Read quantity, unit price and discount percentage, then print the final bill to two decimal places.
๐ฏ Your Task
Read quantity, unit price and discount percentage, then print the final bill to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Quantity is positive; price and discount are non-negative; discount โค 100.
3 249.5 5
Final Bill = 711.07
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
quantity = int(input())
price = float(input())
discount = float(input())
final_bill = quantity * price * (1 - discount / 100)
print(f"Final Bill = {final_bill:.2f}")CHALLENGE 10 EasyPlacement Desk โ Formatted Student Record
Core Skill: f-Strings and Type Conversion
View Challenge โ
Placement Desk โ Formatted Student Record
Placement Desk needs a reliable Python utility. Read a name, age and score, then print one precisely formatted student record.
๐ฏ Your Task
Read a name, age and score, then print one precisely formatted student record.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Name is one non-empty line; 1 โค age โค 120; 0 โค score โค 100.
Ravi 21 84
Name: Ravi | Age: 21 | Score: 84.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
name = input()
age = int(input())
score = float(input())
print(f"Name: {name} | Age: {age} | Score: {score:.2f}")CHALLENGE 11 EasyTeam Dashboard โ Marks Summary
Core Skill: Integer Conversion and Average
View Challenge โ
Team Dashboard โ Marks Summary
Team Dashboard needs a reliable Python utility. Read three integer marks, then display their total and average rounded to two decimal places.
๐ฏ Your Task
Read three integer marks, then display their total and average rounded to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค every mark โค 100.
88 92 96
Total = 276 Average = 92.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
third = int(input())
total = first + second + third
print("Total =", total)
print(f"Average = {total / 3:.2f}")CHALLENGE 12 EasyData Centre โ Temperature Converter
Core Skill: Floating-Point Conversion
View Challenge โ
Data Centre โ Temperature Converter
Data Centre needs a reliable Python utility. Read a Celsius temperature and display its Fahrenheit value rounded to two decimal places.
๐ฏ Your Task
Read a Celsius temperature and display its Fahrenheit value rounded to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-273.15 โค Celsius โค 10000.
37.5
Fahrenheit = 99.50
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
celsius = float(input())
fahrenheit = celsius * 9 / 5 + 32
print(f"Fahrenheit = {fahrenheit:.2f}")CHALLENGE 13 MediumStudent Vault โ Distance Converter
Core Skill: Numeric Types and Units
View Challenge โ
Student Vault โ Distance Converter
Student Vault needs a reliable Python utility. Read a distance in kilometres and display metres and centimetres, both to two decimal places.
๐ฏ Your Task
Read a distance in kilometres and display metres and centimetres, both to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค distance โค 100000.
7
Metres = 7000.00 Centimetres = 700000.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
kilometres = float(input())
print(f"Metres = {kilometres * 1000:.2f}")
print(f"Centimetres = {kilometres * 100000:.2f}")CHALLENGE 14 MediumWorkshop Board โ Discount Bill
Core Skill: Formatted Financial Output
View Challenge โ
Workshop Board โ Discount Bill
Workshop Board needs a reliable Python utility. Read quantity, unit price and discount percentage, then print the final bill to two decimal places.
๐ฏ Your Task
Read quantity, unit price and discount percentage, then print the final bill to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Quantity is positive; price and discount are non-negative; discount โค 100.
8 75 12.5
Final Bill = 525.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
quantity = int(input())
price = float(input())
discount = float(input())
final_bill = quantity * price * (1 - discount / 100)
print(f"Final Bill = {final_bill:.2f}")CHALLENGE 15 MediumCareer Console โ Formatted Student Record
Core Skill: f-Strings and Type Conversion
View Challenge โ
Career Console โ Formatted Student Record
Career Console needs a reliable Python utility. Read a name, age and score, then print one precisely formatted student record.
๐ฏ Your Task
Read a name, age and score, then print one precisely formatted student record.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Name is one non-empty line; 1 โค age โค 120; 0 โค score โค 100.
Meera 20 96.25
Name: Meera | Age: 20 | Score: 96.25
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
name = input()
age = int(input())
score = float(input())
print(f"Name: {name} | Age: {age} | Score: {score:.2f}")CHALLENGE 16 MediumResearch Desk โ Marks Summary
Core Skill: Integer Conversion and Average
View Challenge โ
Research Desk โ Marks Summary
Research Desk needs a reliable Python utility. Read three integer marks, then display their total and average rounded to two decimal places.
๐ฏ Your Task
Read three integer marks, then display their total and average rounded to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค every mark โค 100.
45 67 89
Total = 201 Average = 67.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
third = int(input())
total = first + second + third
print("Total =", total)
print(f"Average = {total / 3:.2f}")CHALLENGE 17 MediumChallenge Arena โ Temperature Converter
Core Skill: Floating-Point Conversion
View Challenge โ
Challenge Arena โ Temperature Converter
Challenge Arena needs a reliable Python utility. Read a Celsius temperature and display its Fahrenheit value rounded to two decimal places.
๐ฏ Your Task
Read a Celsius temperature and display its Fahrenheit value rounded to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-273.15 โค Celsius โค 10000.
-10
Fahrenheit = 14.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
celsius = float(input())
fahrenheit = celsius * 9 / 5 + 32
print(f"Fahrenheit = {fahrenheit:.2f}")CHALLENGE 18 MediumRevision Room โ Distance Converter
Core Skill: Numeric Types and Units
View Challenge โ
Revision Room โ Distance Converter
Revision Room needs a reliable Python utility. Read a distance in kilometres and display metres and centimetres, both to two decimal places.
๐ฏ Your Task
Read a distance in kilometres and display metres and centimetres, both to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค distance โค 100000.
0.75
Metres = 750.00 Centimetres = 75000.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
kilometres = float(input())
print(f"Metres = {kilometres * 1000:.2f}")
print(f"Centimetres = {kilometres * 100000:.2f}")CHALLENGE 19 MediumInterview Lab โ Discount Bill
Core Skill: Formatted Financial Output
View Challenge โ
Interview Lab โ Discount Bill
Interview Lab needs a reliable Python utility. Read quantity, unit price and discount percentage, then print the final bill to two decimal places.
๐ฏ Your Task
Read quantity, unit price and discount percentage, then print the final bill to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Quantity is positive; price and discount are non-negative; discount โค 100.
2 999 20
Final Bill = 1598.40
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
quantity = int(input())
price = float(input())
discount = float(input())
final_bill = quantity * price * (1 - discount / 100)
print(f"Final Bill = {final_bill:.2f}")CHALLENGE 20 MediumCodeBhavya Hub โ Formatted Student Record
Core Skill: f-Strings and Type Conversion
View Challenge โ
CodeBhavya Hub โ Formatted Student Record
CodeBhavya Hub needs a reliable Python utility. Read a name, age and score, then print one precisely formatted student record.
๐ฏ Your Task
Read a name, age and score, then print one precisely formatted student record.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Name is one non-empty line; 1 โค age โค 120; 0 โค score โค 100.
Kiran 22 78.75
Name: Kiran | Age: 22 | Score: 78.75
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
name = input()
age = int(input())
score = float(input())
print(f"Name: {name} | Age: {age} | Score: {score:.2f}")Level 3 โ Operators & ExpressionsArithmetic, precedence, comparison, logic and bitwise work. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Precedence Calculator
Core Skill: Operator Precedence
View Challenge โ
Orientation Desk โ Precedence Calculator
Orientation Desk needs a reliable Python utility. Read a, b and c, then evaluate a + b * c using Python precedence.
๐ฏ Your Task
Read a, b and c, then evaluate a + b * c using Python precedence.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-1000 โค a, b, c โค 1000.
4 7 3
Result = 25
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
print("Result =", a + b * c)CHALLENGE 02 EasyCampus Portal โ Division Report
Core Skill: Floor Division and Modulus
View Challenge โ
Campus Portal โ Division Report
Campus Portal needs a reliable Python utility. Read a positive dividend and divisor, then display quotient and remainder.
๐ฏ Your Task
Read a positive dividend and divisor, then display quotient and remainder.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค divisor โค dividend โค 1000000.
29 5
Quotient = 5 Remainder = 4
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
dividend = int(input())
divisor = int(input())
print("Quotient =", dividend // divisor)
print("Remainder =", dividend % divisor)CHALLENGE 03 EasyLearning Studio โ Three-Digit Extractor
Core Skill: Integer Division and Remainder
View Challenge โ
Learning Studio โ Three-Digit Extractor
Learning Studio needs a reliable Python utility. Read a three-digit positive integer and display its hundreds, tens and ones digits.
๐ฏ Your Task
Read a three-digit positive integer and display its hundreds, tens and ones digits.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
100 โค number โค 999.
472
Digits = 4 7 2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
print("Digits =", number // 100, number // 10 % 10, number % 10)CHALLENGE 04 EasySkill Tracker โ Range Membership Test
Core Skill: Comparison and Logical Operators
View Challenge โ
Skill Tracker โ Range Membership Test
Skill Tracker needs a reliable Python utility. Print True only when the integer lies from 10 through 50 inclusive and is not divisible by 5.
๐ฏ Your Task
Print True only when the integer lies from 10 through 50 inclusive and is not divisible by 5.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-100000 โค number โค 100000.
27
True
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
print(10 <= number <= 50 and number % 5 != 0)CHALLENGE 05 EasyMentor Console โ Bitwise Console
Core Skill: Bitwise Operators
View Challenge โ
Mentor Console โ Bitwise Console
Mentor Console needs a reliable Python utility. Read two non-negative integers and display their bitwise AND, OR and XOR.
๐ฏ Your Task
Read two non-negative integers and display their bitwise AND, OR and XOR.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค each integer โค 1000000.
6 3
AND = 2 OR = 7 XOR = 5
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
print("AND =", first & second)
print("OR =", first | second)
print("XOR =", first ^ second)CHALLENGE 06 EasyLibrary Counter โ Precedence Calculator
Core Skill: Operator Precedence
View Challenge โ
Library Counter โ Precedence Calculator
Library Counter needs a reliable Python utility. Read a, b and c, then evaluate a + b * c using Python precedence.
๐ฏ Your Task
Read a, b and c, then evaluate a + b * c using Python precedence.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-1000 โค a, b, c โค 1000.
8 2 5
Result = 18
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
print("Result =", a + b * c)CHALLENGE 07 EasyPractice Lab โ Division Report
Core Skill: Floor Division and Modulus
View Challenge โ
Practice Lab โ Division Report
Practice Lab needs a reliable Python utility. Read a positive dividend and divisor, then display quotient and remainder.
๐ฏ Your Task
Read a positive dividend and divisor, then display quotient and remainder.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค divisor โค dividend โค 1000000.
100 9
Quotient = 11 Remainder = 1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
dividend = int(input())
divisor = int(input())
print("Quotient =", dividend // divisor)
print("Remainder =", dividend % divisor)CHALLENGE 08 MediumQuiz Engine โ Three-Digit Extractor
Core Skill: Integer Division and Remainder
View Challenge โ
Quiz Engine โ Three-Digit Extractor
Quiz Engine needs a reliable Python utility. Read a three-digit positive integer and display its hundreds, tens and ones digits.
๐ฏ Your Task
Read a three-digit positive integer and display its hundreds, tens and ones digits.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
100 โค number โค 999.
905
Digits = 9 0 5
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
print("Digits =", number // 100, number // 10 % 10, number % 10)CHALLENGE 09 MediumProject Hub โ Range Membership Test
Core Skill: Comparison and Logical Operators
View Challenge โ
Project Hub โ Range Membership Test
Project Hub needs a reliable Python utility. Print True only when the integer lies from 10 through 50 inclusive and is not divisible by 5.
๐ฏ Your Task
Print True only when the integer lies from 10 through 50 inclusive and is not divisible by 5.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-100000 โค number โค 100000.
45
False
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
print(10 <= number <= 50 and number % 5 != 0)CHALLENGE 10 MediumPlacement Desk โ Bitwise Console
Core Skill: Bitwise Operators
View Challenge โ
Placement Desk โ Bitwise Console
Placement Desk needs a reliable Python utility. Read two non-negative integers and display their bitwise AND, OR and XOR.
๐ฏ Your Task
Read two non-negative integers and display their bitwise AND, OR and XOR.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค each integer โค 1000000.
12 5
AND = 4 OR = 13 XOR = 9
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
print("AND =", first & second)
print("OR =", first | second)
print("XOR =", first ^ second)CHALLENGE 11 MediumTeam Dashboard โ Precedence Calculator
Core Skill: Operator Precedence
View Challenge โ
Team Dashboard โ Precedence Calculator
Team Dashboard needs a reliable Python utility. Read a, b and c, then evaluate a + b * c using Python precedence.
๐ฏ Your Task
Read a, b and c, then evaluate a + b * c using Python precedence.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-1000 โค a, b, c โค 1000.
10 6 2
Result = 22
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
print("Result =", a + b * c)CHALLENGE 12 MediumData Centre โ Division Report
Core Skill: Floor Division and Modulus
View Challenge โ
Data Centre โ Division Report
Data Centre needs a reliable Python utility. Read a positive dividend and divisor, then display quotient and remainder.
๐ฏ Your Task
Read a positive dividend and divisor, then display quotient and remainder.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค divisor โค dividend โค 1000000.
47 6
Quotient = 7 Remainder = 5
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
dividend = int(input())
divisor = int(input())
print("Quotient =", dividend // divisor)
print("Remainder =", dividend % divisor)CHALLENGE 13 MediumStudent Vault โ Three-Digit Extractor
Core Skill: Integer Division and Remainder
View Challenge โ
Student Vault โ Three-Digit Extractor
Student Vault needs a reliable Python utility. Read a three-digit positive integer and display its hundreds, tens and ones digits.
๐ฏ Your Task
Read a three-digit positive integer and display its hundreds, tens and ones digits.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
100 โค number โค 999.
381
Digits = 3 8 1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
print("Digits =", number // 100, number // 10 % 10, number % 10)CHALLENGE 14 MediumWorkshop Board โ Range Membership Test
Core Skill: Comparison and Logical Operators
View Challenge โ
Workshop Board โ Range Membership Test
Workshop Board needs a reliable Python utility. Print True only when the integer lies from 10 through 50 inclusive and is not divisible by 5.
๐ฏ Your Task
Print True only when the integer lies from 10 through 50 inclusive and is not divisible by 5.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-100000 โค number โค 100000.
11
True
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
print(10 <= number <= 50 and number % 5 != 0)CHALLENGE 15 MediumCareer Console โ Bitwise Console
Core Skill: Bitwise Operators
View Challenge โ
Career Console โ Bitwise Console
Career Console needs a reliable Python utility. Read two non-negative integers and display their bitwise AND, OR and XOR.
๐ฏ Your Task
Read two non-negative integers and display their bitwise AND, OR and XOR.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค each integer โค 1000000.
9 10
AND = 8 OR = 11 XOR = 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
print("AND =", first & second)
print("OR =", first | second)
print("XOR =", first ^ second)CHALLENGE 16 MediumResearch Desk โ Precedence Calculator
Core Skill: Operator Precedence
View Challenge โ
Research Desk โ Precedence Calculator
Research Desk needs a reliable Python utility. Read a, b and c, then evaluate a + b * c using Python precedence.
๐ฏ Your Task
Read a, b and c, then evaluate a + b * c using Python precedence.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-1000 โค a, b, c โค 1000.
3 9 4
Result = 39
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
print("Result =", a + b * c)CHALLENGE 17 HardChallenge Arena โ Division Report
Core Skill: Floor Division and Modulus
View Challenge โ
Challenge Arena โ Division Report
Challenge Arena needs a reliable Python utility. Read a positive dividend and divisor, then display quotient and remainder.
๐ฏ Your Task
Read a positive dividend and divisor, then display quotient and remainder.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค divisor โค dividend โค 1000000.
88 7
Quotient = 12 Remainder = 4
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
dividend = int(input())
divisor = int(input())
print("Quotient =", dividend // divisor)
print("Remainder =", dividend % divisor)CHALLENGE 18 HardRevision Room โ Three-Digit Extractor
Core Skill: Integer Division and Remainder
View Challenge โ
Revision Room โ Three-Digit Extractor
Revision Room needs a reliable Python utility. Read a three-digit positive integer and display its hundreds, tens and ones digits.
๐ฏ Your Task
Read a three-digit positive integer and display its hundreds, tens and ones digits.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
100 โค number โค 999.
764
Digits = 7 6 4
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
print("Digits =", number // 100, number // 10 % 10, number % 10)CHALLENGE 19 HardInterview Lab โ Range Membership Test
Core Skill: Comparison and Logical Operators
View Challenge โ
Interview Lab โ Range Membership Test
Interview Lab needs a reliable Python utility. Print True only when the integer lies from 10 through 50 inclusive and is not divisible by 5.
๐ฏ Your Task
Print True only when the integer lies from 10 through 50 inclusive and is not divisible by 5.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-100000 โค number โค 100000.
52
False
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
print(10 <= number <= 50 and number % 5 != 0)CHALLENGE 20 HardCodeBhavya Hub โ Bitwise Console
Core Skill: Bitwise Operators
View Challenge โ
CodeBhavya Hub โ Bitwise Console
CodeBhavya Hub needs a reliable Python utility. Read two non-negative integers and display their bitwise AND, OR and XOR.
๐ฏ Your Task
Read two non-negative integers and display their bitwise AND, OR and XOR.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค each integer โค 1000000.
15 7
AND = 7 OR = 15 XOR = 8
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = int(input())
second = int(input())
print("AND =", first & second)
print("OR =", first | second)
print("XOR =", first ^ second)Level 4 โ Decision MakingConditions, chained decisions and boundary handling. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Number Classifier
Core Skill: if / elif / else
View Challenge โ
Orientation Desk โ Number Classifier
Orientation Desk needs a reliable Python utility. Read an integer and classify it as Positive, Negative or Zero.
๐ฏ Your Task
Read an integer and classify it as Positive, Negative or Zero.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-10^9 โค number โค 10^9.
18
Positive
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
if number > 0:
print("Positive")
elif number < 0:
print("Negative")
else:
print("Zero")CHALLENGE 02 EasyCampus Portal โ Largest of Three
Core Skill: Chained Comparisons
View Challenge โ
Campus Portal โ Largest of Three
Campus Portal needs a reliable Python utility. Read three integers and display the largest value.
๐ฏ Your Task
Read three integers and display the largest value.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Values may be equal and may be negative.
5 12 9
Largest = 12
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
print("Largest =", max(a, b, c))CHALLENGE 03 EasyLearning Studio โ Grade Boundary
Core Skill: Ordered elif Conditions
View Challenge โ
Learning Studio โ Grade Boundary
Learning Studio needs a reliable Python utility. Read a mark and print Grade = A, B, C, D or F using 90, 80, 70 and 60 as the boundaries.
๐ฏ Your Task
Read a mark and print Grade = A, B, C, D or F using 90, 80, 70 and 60 as the boundaries.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค mark โค 100.
94
Grade = A
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
mark = int(input())
if mark >= 90:
grade = "A"
elif mark >= 80:
grade = "B"
elif mark >= 70:
grade = "C"
elif mark >= 60:
grade = "D"
else:
grade = "F"
print("Grade =", grade)CHALLENGE 04 EasySkill Tracker โ Leap Year Validator
Core Skill: Nested Logical Conditions
View Challenge โ
Skill Tracker โ Leap Year Validator
Skill Tracker needs a reliable Python utility. Read a year and determine whether it is a leap year under Gregorian calendar rules.
๐ฏ Your Task
Read a year and determine whether it is a leap year under Gregorian calendar rules.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค year โค 9999.
2024
Leap Year
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
year = int(input())
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
print("Leap Year")
else:
print("Not Leap Year")CHALLENGE 05 EasyMentor Console โ Triangle Inspector
Core Skill: Compound Conditions
View Challenge โ
Mentor Console โ Triangle Inspector
Mentor Console needs a reliable Python utility. Read three positive side lengths. Print Invalid, Equilateral, Isosceles or Scalene.
๐ฏ Your Task
Read three positive side lengths. Print Invalid, Equilateral, Isosceles or Scalene.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค each side โค 100000.
5 5 5
Equilateral
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
if a + b <= c or a + c <= b or b + c <= a:
print("Invalid")
elif a == b == c:
print("Equilateral")
elif a == b or b == c or a == c:
print("Isosceles")
else:
print("Scalene")CHALLENGE 06 EasyLibrary Counter โ Number Classifier
Core Skill: if / elif / else
View Challenge โ
Library Counter โ Number Classifier
Library Counter needs a reliable Python utility. Read an integer and classify it as Positive, Negative or Zero.
๐ฏ Your Task
Read an integer and classify it as Positive, Negative or Zero.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-10^9 โค number โค 10^9.
-7
Negative
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
if number > 0:
print("Positive")
elif number < 0:
print("Negative")
else:
print("Zero")CHALLENGE 07 EasyPractice Lab โ Largest of Three
Core Skill: Chained Comparisons
View Challenge โ
Practice Lab โ Largest of Three
Practice Lab needs a reliable Python utility. Read three integers and display the largest value.
๐ฏ Your Task
Read three integers and display the largest value.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Values may be equal and may be negative.
40 7 18
Largest = 40
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
print("Largest =", max(a, b, c))CHALLENGE 08 MediumQuiz Engine โ Grade Boundary
Core Skill: Ordered elif Conditions
View Challenge โ
Quiz Engine โ Grade Boundary
Quiz Engine needs a reliable Python utility. Read a mark and print Grade = A, B, C, D or F using 90, 80, 70 and 60 as the boundaries.
๐ฏ Your Task
Read a mark and print Grade = A, B, C, D or F using 90, 80, 70 and 60 as the boundaries.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค mark โค 100.
82
Grade = B
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
mark = int(input())
if mark >= 90:
grade = "A"
elif mark >= 80:
grade = "B"
elif mark >= 70:
grade = "C"
elif mark >= 60:
grade = "D"
else:
grade = "F"
print("Grade =", grade)CHALLENGE 09 MediumProject Hub โ Leap Year Validator
Core Skill: Nested Logical Conditions
View Challenge โ
Project Hub โ Leap Year Validator
Project Hub needs a reliable Python utility. Read a year and determine whether it is a leap year under Gregorian calendar rules.
๐ฏ Your Task
Read a year and determine whether it is a leap year under Gregorian calendar rules.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค year โค 9999.
1900
Not Leap Year
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
year = int(input())
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
print("Leap Year")
else:
print("Not Leap Year")CHALLENGE 10 MediumPlacement Desk โ Triangle Inspector
Core Skill: Compound Conditions
View Challenge โ
Placement Desk โ Triangle Inspector
Placement Desk needs a reliable Python utility. Read three positive side lengths. Print Invalid, Equilateral, Isosceles or Scalene.
๐ฏ Your Task
Read three positive side lengths. Print Invalid, Equilateral, Isosceles or Scalene.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค each side โค 100000.
5 5 8
Isosceles
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
if a + b <= c or a + c <= b or b + c <= a:
print("Invalid")
elif a == b == c:
print("Equilateral")
elif a == b or b == c or a == c:
print("Isosceles")
else:
print("Scalene")CHALLENGE 11 MediumTeam Dashboard โ Number Classifier
Core Skill: if / elif / else
View Challenge โ
Team Dashboard โ Number Classifier
Team Dashboard needs a reliable Python utility. Read an integer and classify it as Positive, Negative or Zero.
๐ฏ Your Task
Read an integer and classify it as Positive, Negative or Zero.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-10^9 โค number โค 10^9.
0
Zero
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
if number > 0:
print("Positive")
elif number < 0:
print("Negative")
else:
print("Zero")CHALLENGE 12 MediumData Centre โ Largest of Three
Core Skill: Chained Comparisons
View Challenge โ
Data Centre โ Largest of Three
Data Centre needs a reliable Python utility. Read three integers and display the largest value.
๐ฏ Your Task
Read three integers and display the largest value.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Values may be equal and may be negative.
-3 -8 -1
Largest = -1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
print("Largest =", max(a, b, c))CHALLENGE 13 MediumStudent Vault โ Grade Boundary
Core Skill: Ordered elif Conditions
View Challenge โ
Student Vault โ Grade Boundary
Student Vault needs a reliable Python utility. Read a mark and print Grade = A, B, C, D or F using 90, 80, 70 and 60 as the boundaries.
๐ฏ Your Task
Read a mark and print Grade = A, B, C, D or F using 90, 80, 70 and 60 as the boundaries.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค mark โค 100.
67
Grade = D
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
mark = int(input())
if mark >= 90:
grade = "A"
elif mark >= 80:
grade = "B"
elif mark >= 70:
grade = "C"
elif mark >= 60:
grade = "D"
else:
grade = "F"
print("Grade =", grade)CHALLENGE 14 MediumWorkshop Board โ Leap Year Validator
Core Skill: Nested Logical Conditions
View Challenge โ
Workshop Board โ Leap Year Validator
Workshop Board needs a reliable Python utility. Read a year and determine whether it is a leap year under Gregorian calendar rules.
๐ฏ Your Task
Read a year and determine whether it is a leap year under Gregorian calendar rules.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค year โค 9999.
2000
Leap Year
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
year = int(input())
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
print("Leap Year")
else:
print("Not Leap Year")CHALLENGE 15 MediumCareer Console โ Triangle Inspector
Core Skill: Compound Conditions
View Challenge โ
Career Console โ Triangle Inspector
Career Console needs a reliable Python utility. Read three positive side lengths. Print Invalid, Equilateral, Isosceles or Scalene.
๐ฏ Your Task
Read three positive side lengths. Print Invalid, Equilateral, Isosceles or Scalene.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค each side โค 100000.
3 4 5
Scalene
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
if a + b <= c or a + c <= b or b + c <= a:
print("Invalid")
elif a == b == c:
print("Equilateral")
elif a == b or b == c or a == c:
print("Isosceles")
else:
print("Scalene")CHALLENGE 16 MediumResearch Desk โ Number Classifier
Core Skill: if / elif / else
View Challenge โ
Research Desk โ Number Classifier
Research Desk needs a reliable Python utility. Read an integer and classify it as Positive, Negative or Zero.
๐ฏ Your Task
Read an integer and classify it as Positive, Negative or Zero.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-10^9 โค number โค 10^9.
125
Positive
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
if number > 0:
print("Positive")
elif number < 0:
print("Negative")
else:
print("Zero")CHALLENGE 17 HardChallenge Arena โ Largest of Three
Core Skill: Chained Comparisons
View Challenge โ
Challenge Arena โ Largest of Three
Challenge Arena needs a reliable Python utility. Read three integers and display the largest value.
๐ฏ Your Task
Read three integers and display the largest value.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Values may be equal and may be negative.
100 100 25
Largest = 100
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
print("Largest =", max(a, b, c))CHALLENGE 18 HardRevision Room โ Grade Boundary
Core Skill: Ordered elif Conditions
View Challenge โ
Revision Room โ Grade Boundary
Revision Room needs a reliable Python utility. Read a mark and print Grade = A, B, C, D or F using 90, 80, 70 and 60 as the boundaries.
๐ฏ Your Task
Read a mark and print Grade = A, B, C, D or F using 90, 80, 70 and 60 as the boundaries.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค mark โค 100.
48
Grade = F
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
mark = int(input())
if mark >= 90:
grade = "A"
elif mark >= 80:
grade = "B"
elif mark >= 70:
grade = "C"
elif mark >= 60:
grade = "D"
else:
grade = "F"
print("Grade =", grade)CHALLENGE 19 HardInterview Lab โ Leap Year Validator
Core Skill: Nested Logical Conditions
View Challenge โ
Interview Lab โ Leap Year Validator
Interview Lab needs a reliable Python utility. Read a year and determine whether it is a leap year under Gregorian calendar rules.
๐ฏ Your Task
Read a year and determine whether it is a leap year under Gregorian calendar rules.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค year โค 9999.
2023
Not Leap Year
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
year = int(input())
if year % 400 == 0 or (year % 4 == 0 and year % 100 != 0):
print("Leap Year")
else:
print("Not Leap Year")CHALLENGE 20 HardCodeBhavya Hub โ Triangle Inspector
Core Skill: Compound Conditions
View Challenge โ
CodeBhavya Hub โ Triangle Inspector
CodeBhavya Hub needs a reliable Python utility. Read three positive side lengths. Print Invalid, Equilateral, Isosceles or Scalene.
๐ฏ Your Task
Read three positive side lengths. Print Invalid, Equilateral, Isosceles or Scalene.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค each side โค 100000.
1 2 8
Invalid
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
a = int(input())
b = int(input())
c = int(input())
if a + b <= c or a + c <= b or b + c <= a:
print("Invalid")
elif a == b == c:
print("Equilateral")
elif a == b or b == c or a == c:
print("Isosceles")
else:
print("Scalene")Level 5 โ Loops & PatternsIteration, accumulators, digit logic and visual patterns. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Range Sum
Core Skill: for Loop and Accumulator
View Challenge โ
Orientation Desk โ Range Sum
Orientation Desk needs a reliable Python utility. Read n and calculate the sum of all integers from 1 through n using a loop.
๐ฏ Your Task
Read n and calculate the sum of all integers from 1 through n using a loop.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000.
10
Sum = 55
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
total = 0
for value in range(1, n + 1):
total += value
print("Sum =", total)CHALLENGE 02 EasyCampus Portal โ Factorial Counter
Core Skill: Loop Multiplication
View Challenge โ
Campus Portal โ Factorial Counter
Campus Portal needs a reliable Python utility. Read a non-negative integer and calculate its factorial.
๐ฏ Your Task
Read a non-negative integer and calculate its factorial.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 20.
5
Factorial = 120
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
result = 1
for value in range(2, n + 1):
result *= value
print("Factorial =", result)CHALLENGE 03 EasyLearning Studio โ Digit Sum Scanner
Core Skill: while Loop and Modulus
View Challenge โ
Learning Studio โ Digit Sum Scanner
Learning Studio needs a reliable Python utility. Read a positive integer and calculate the sum of its digits.
๐ฏ Your Task
Read a positive integer and calculate the sum of its digits.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค number โค 10^18.
48271
Digit Sum = 22
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
total = 0
while number > 0:
total += number % 10
number //= 10
print("Digit Sum =", total)CHALLENGE 04 EasySkill Tracker โ Five-Step Table
Core Skill: Loop-Controlled Output
View Challenge โ
Skill Tracker โ Five-Step Table
Skill Tracker needs a reliable Python utility. Read n and display the first five multiples in the exact n x i = product format.
๐ฏ Your Task
Read n and display the first five multiples in the exact n x i = product format.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-1000 โค n โค 1000.
3
3 x 1 = 3 3 x 2 = 6 3 x 3 = 9 3 x 4 = 12 3 x 5 = 15
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
for i in range(1, 6):
print(f"{number} x {i} = {number * i}")CHALLENGE 05 EasyMentor Console โ Growing Star Pattern
Core Skill: Nested Pattern Logic
View Challenge โ
Mentor Console โ Growing Star Pattern
Mentor Console needs a reliable Python utility. Read n and print a left-aligned triangle containing one star on row 1 through n stars on row n.
๐ฏ Your Task
Read n and print a left-aligned triangle containing one star on row 1 through n stars on row n.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 30.
3
* ** ***
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
for row in range(1, n + 1):
print("*" * row)CHALLENGE 06 EasyLibrary Counter โ Range Sum
Core Skill: for Loop and Accumulator
View Challenge โ
Library Counter โ Range Sum
Library Counter needs a reliable Python utility. Read n and calculate the sum of all integers from 1 through n using a loop.
๐ฏ Your Task
Read n and calculate the sum of all integers from 1 through n using a loop.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000.
25
Sum = 325
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
total = 0
for value in range(1, n + 1):
total += value
print("Sum =", total)CHALLENGE 07 EasyPractice Lab โ Factorial Counter
Core Skill: Loop Multiplication
View Challenge โ
Practice Lab โ Factorial Counter
Practice Lab needs a reliable Python utility. Read a non-negative integer and calculate its factorial.
๐ฏ Your Task
Read a non-negative integer and calculate its factorial.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 20.
6
Factorial = 720
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
result = 1
for value in range(2, n + 1):
result *= value
print("Factorial =", result)CHALLENGE 08 MediumQuiz Engine โ Digit Sum Scanner
Core Skill: while Loop and Modulus
View Challenge โ
Quiz Engine โ Digit Sum Scanner
Quiz Engine needs a reliable Python utility. Read a positive integer and calculate the sum of its digits.
๐ฏ Your Task
Read a positive integer and calculate the sum of its digits.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค number โค 10^18.
9005
Digit Sum = 14
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
total = 0
while number > 0:
total += number % 10
number //= 10
print("Digit Sum =", total)CHALLENGE 09 MediumProject Hub โ Five-Step Table
Core Skill: Loop-Controlled Output
View Challenge โ
Project Hub โ Five-Step Table
Project Hub needs a reliable Python utility. Read n and display the first five multiples in the exact n x i = product format.
๐ฏ Your Task
Read n and display the first five multiples in the exact n x i = product format.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-1000 โค n โค 1000.
7
7 x 1 = 7 7 x 2 = 14 7 x 3 = 21 7 x 4 = 28 7 x 5 = 35
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
for i in range(1, 6):
print(f"{number} x {i} = {number * i}")CHALLENGE 10 MediumPlacement Desk โ Growing Star Pattern
Core Skill: Nested Pattern Logic
View Challenge โ
Placement Desk โ Growing Star Pattern
Placement Desk needs a reliable Python utility. Read n and print a left-aligned triangle containing one star on row 1 through n stars on row n.
๐ฏ Your Task
Read n and print a left-aligned triangle containing one star on row 1 through n stars on row n.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 30.
4
* ** *** ****
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
for row in range(1, n + 1):
print("*" * row)CHALLENGE 11 MediumTeam Dashboard โ Range Sum
Core Skill: for Loop and Accumulator
View Challenge โ
Team Dashboard โ Range Sum
Team Dashboard needs a reliable Python utility. Read n and calculate the sum of all integers from 1 through n using a loop.
๐ฏ Your Task
Read n and calculate the sum of all integers from 1 through n using a loop.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000.
50
Sum = 1275
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
total = 0
for value in range(1, n + 1):
total += value
print("Sum =", total)CHALLENGE 12 MediumData Centre โ Factorial Counter
Core Skill: Loop Multiplication
View Challenge โ
Data Centre โ Factorial Counter
Data Centre needs a reliable Python utility. Read a non-negative integer and calculate its factorial.
๐ฏ Your Task
Read a non-negative integer and calculate its factorial.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 20.
7
Factorial = 5040
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
result = 1
for value in range(2, n + 1):
result *= value
print("Factorial =", result)CHALLENGE 13 MediumStudent Vault โ Digit Sum Scanner
Core Skill: while Loop and Modulus
View Challenge โ
Student Vault โ Digit Sum Scanner
Student Vault needs a reliable Python utility. Read a positive integer and calculate the sum of its digits.
๐ฏ Your Task
Read a positive integer and calculate the sum of its digits.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค number โค 10^18.
12345
Digit Sum = 15
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
total = 0
while number > 0:
total += number % 10
number //= 10
print("Digit Sum =", total)CHALLENGE 14 MediumWorkshop Board โ Five-Step Table
Core Skill: Loop-Controlled Output
View Challenge โ
Workshop Board โ Five-Step Table
Workshop Board needs a reliable Python utility. Read n and display the first five multiples in the exact n x i = product format.
๐ฏ Your Task
Read n and display the first five multiples in the exact n x i = product format.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-1000 โค n โค 1000.
12
12 x 1 = 12 12 x 2 = 24 12 x 3 = 36 12 x 4 = 48 12 x 5 = 60
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
for i in range(1, 6):
print(f"{number} x {i} = {number * i}")CHALLENGE 15 MediumCareer Console โ Growing Star Pattern
Core Skill: Nested Pattern Logic
View Challenge โ
Career Console โ Growing Star Pattern
Career Console needs a reliable Python utility. Read n and print a left-aligned triangle containing one star on row 1 through n stars on row n.
๐ฏ Your Task
Read n and print a left-aligned triangle containing one star on row 1 through n stars on row n.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 30.
5
* ** *** **** *****
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
for row in range(1, n + 1):
print("*" * row)CHALLENGE 16 MediumResearch Desk โ Range Sum
Core Skill: for Loop and Accumulator
View Challenge โ
Research Desk โ Range Sum
Research Desk needs a reliable Python utility. Read n and calculate the sum of all integers from 1 through n using a loop.
๐ฏ Your Task
Read n and calculate the sum of all integers from 1 through n using a loop.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000.
100
Sum = 5050
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
total = 0
for value in range(1, n + 1):
total += value
print("Sum =", total)CHALLENGE 17 HardChallenge Arena โ Factorial Counter
Core Skill: Loop Multiplication
View Challenge โ
Challenge Arena โ Factorial Counter
Challenge Arena needs a reliable Python utility. Read a non-negative integer and calculate its factorial.
๐ฏ Your Task
Read a non-negative integer and calculate its factorial.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 20.
8
Factorial = 40320
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
result = 1
for value in range(2, n + 1):
result *= value
print("Factorial =", result)CHALLENGE 18 HardRevision Room โ Digit Sum Scanner
Core Skill: while Loop and Modulus
View Challenge โ
Revision Room โ Digit Sum Scanner
Revision Room needs a reliable Python utility. Read a positive integer and calculate the sum of its digits.
๐ฏ Your Task
Read a positive integer and calculate the sum of its digits.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค number โค 10^18.
80808
Digit Sum = 24
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
total = 0
while number > 0:
total += number % 10
number //= 10
print("Digit Sum =", total)CHALLENGE 19 HardInterview Lab โ Five-Step Table
Core Skill: Loop-Controlled Output
View Challenge โ
Interview Lab โ Five-Step Table
Interview Lab needs a reliable Python utility. Read n and display the first five multiples in the exact n x i = product format.
๐ฏ Your Task
Read n and display the first five multiples in the exact n x i = product format.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
-1000 โค n โค 1000.
15
15 x 1 = 15 15 x 2 = 30 15 x 3 = 45 15 x 4 = 60 15 x 5 = 75
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
number = int(input())
for i in range(1, 6):
print(f"{number} x {i} = {number * i}")CHALLENGE 20 HardCodeBhavya Hub โ Growing Star Pattern
Core Skill: Nested Pattern Logic
View Challenge โ
CodeBhavya Hub โ Growing Star Pattern
CodeBhavya Hub needs a reliable Python utility. Read n and print a left-aligned triangle containing one star on row 1 through n stars on row n.
๐ฏ Your Task
Read n and print a left-aligned triangle containing one star on row 1 through n stars on row n.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 30.
6
* ** *** **** ***** ******
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
for row in range(1, n + 1):
print("*" * row)Level 6 โ StringsTraversal, slicing, normalisation and text analysis. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Vowel Frequency
Core Skill: String Traversal
View Challenge โ
Orientation Desk โ Vowel Frequency
Orientation Desk needs a reliable Python utility. Read one line of text and count its vowels without treating uppercase and lowercase differently.
๐ฏ Your Task
Read one line of text and count its vowels without treating uppercase and lowercase differently.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains at most 1000 characters.
CodeBhavya
Vowels = 4
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input().lower()
count = 0
for character in text:
if character in "aeiou":
count += 1
print("Vowels =", count)CHALLENGE 02 EasyCampus Portal โ Normalised Palindrome
Core Skill: String Normalisation and Slicing
View Challenge โ
Campus Portal โ Normalised Palindrome
Campus Portal needs a reliable Python utility. Read a phrase and determine whether it is a palindrome after ignoring spaces, punctuation and letter case.
๐ฏ Your Task
Read a phrase and determine whether it is a palindrome after ignoring spaces, punctuation and letter case.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The phrase contains at most 1000 characters.
Never odd or even
Palindrome
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
cleaned = "".join(character.lower() for character in text if character.isalnum())
print("Palindrome" if cleaned == cleaned[::-1] else "Not Palindrome")CHALLENGE 03 EasyLearning Studio โ Reverse Word Order
Core Skill: split(), Slicing and join()
View Challenge โ
Learning Studio โ Reverse Word Order
Learning Studio needs a reliable Python utility. Read a sentence and print its words in reverse order without reversing the letters inside each word.
๐ฏ Your Task
Read a sentence and print its words in reverse order without reversing the letters inside each word.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence has 1 to 100 whitespace-separated words.
learn practice build
build practice learn
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
sentence = input()
words = sentence.split()
print(" ".join(words[::-1]))CHALLENGE 04 EasySkill Tracker โ Character Counter
Core Skill: Character Frequency
View Challenge โ
Skill Tracker โ Character Counter
Skill Tracker needs a reliable Python utility. Read a text line and then one character. Print how many times that exact character occurs.
๐ฏ Your Task
Read a text line and then one character. Print how many times that exact character occurs.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The character input contains exactly one character; matching is case-sensitive.
banana a
Count = 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
character = input()
print("Count =", text.count(character))CHALLENGE 05 EasyMentor Console โ Longest Word Finder
Core Skill: Word Processing
View Challenge โ
Mentor Console โ Longest Word Finder
Mentor Console needs a reliable Python utility. Read a sentence and print its longest word. If several words tie, print the first one.
๐ฏ Your Task
Read a sentence and print its longest word. If several words tie, print the first one.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence contains at least one word and at most 1000 characters.
learn build grow
Longest = learn
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
print("Longest =", max(words, key=len))CHALLENGE 06 MediumLibrary Counter โ Vowel Frequency
Core Skill: String Traversal
View Challenge โ
Library Counter โ Vowel Frequency
Library Counter needs a reliable Python utility. Read one line of text and count its vowels without treating uppercase and lowercase differently.
๐ฏ Your Task
Read one line of text and count its vowels without treating uppercase and lowercase differently.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains at most 1000 characters.
Education
Vowels = 5
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input().lower()
count = 0
for character in text:
if character in "aeiou":
count += 1
print("Vowels =", count)CHALLENGE 07 MediumPractice Lab โ Normalised Palindrome
Core Skill: String Normalisation and Slicing
View Challenge โ
Practice Lab โ Normalised Palindrome
Practice Lab needs a reliable Python utility. Read a phrase and determine whether it is a palindrome after ignoring spaces, punctuation and letter case.
๐ฏ Your Task
Read a phrase and determine whether it is a palindrome after ignoring spaces, punctuation and letter case.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The phrase contains at most 1000 characters.
A man a plan a canal Panama
Palindrome
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
cleaned = "".join(character.lower() for character in text if character.isalnum())
print("Palindrome" if cleaned == cleaned[::-1] else "Not Palindrome")CHALLENGE 08 MediumQuiz Engine โ Reverse Word Order
Core Skill: split(), Slicing and join()
View Challenge โ
Quiz Engine โ Reverse Word Order
Quiz Engine needs a reliable Python utility. Read a sentence and print its words in reverse order without reversing the letters inside each word.
๐ฏ Your Task
Read a sentence and print its words in reverse order without reversing the letters inside each word.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence has 1 to 100 whitespace-separated words.
python makes ideas real
real ideas makes python
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
sentence = input()
words = sentence.split()
print(" ".join(words[::-1]))CHALLENGE 09 MediumProject Hub โ Character Counter
Core Skill: Character Frequency
View Challenge โ
Project Hub โ Character Counter
Project Hub needs a reliable Python utility. Read a text line and then one character. Print how many times that exact character occurs.
๐ฏ Your Task
Read a text line and then one character. Print how many times that exact character occurs.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The character input contains exactly one character; matching is case-sensitive.
mississippi s
Count = 4
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
character = input()
print("Count =", text.count(character))CHALLENGE 10 MediumPlacement Desk โ Longest Word Finder
Core Skill: Word Processing
View Challenge โ
Placement Desk โ Longest Word Finder
Placement Desk needs a reliable Python utility. Read a sentence and print its longest word. If several words tie, print the first one.
๐ฏ Your Task
Read a sentence and print its longest word. If several words tie, print the first one.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence contains at least one word and at most 1000 characters.
Python makes automation enjoyable
Longest = automation
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
print("Longest =", max(words, key=len))CHALLENGE 11 MediumTeam Dashboard โ Vowel Frequency
Core Skill: String Traversal
View Challenge โ
Team Dashboard โ Vowel Frequency
Team Dashboard needs a reliable Python utility. Read one line of text and count its vowels without treating uppercase and lowercase differently.
๐ฏ Your Task
Read one line of text and count its vowels without treating uppercase and lowercase differently.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains at most 1000 characters.
Programming
Vowels = 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input().lower()
count = 0
for character in text:
if character in "aeiou":
count += 1
print("Vowels =", count)CHALLENGE 12 MediumData Centre โ Normalised Palindrome
Core Skill: String Normalisation and Slicing
View Challenge โ
Data Centre โ Normalised Palindrome
Data Centre needs a reliable Python utility. Read a phrase and determine whether it is a palindrome after ignoring spaces, punctuation and letter case.
๐ฏ Your Task
Read a phrase and determine whether it is a palindrome after ignoring spaces, punctuation and letter case.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The phrase contains at most 1000 characters.
Python
Not Palindrome
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
cleaned = "".join(character.lower() for character in text if character.isalnum())
print("Palindrome" if cleaned == cleaned[::-1] else "Not Palindrome")CHALLENGE 13 MediumStudent Vault โ Reverse Word Order
Core Skill: split(), Slicing and join()
View Challenge โ
Student Vault โ Reverse Word Order
Student Vault needs a reliable Python utility. Read a sentence and print its words in reverse order without reversing the letters inside each word.
๐ฏ Your Task
Read a sentence and print its words in reverse order without reversing the letters inside each word.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence has 1 to 100 whitespace-separated words.
trace before you run
run you before trace
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
sentence = input()
words = sentence.split()
print(" ".join(words[::-1]))CHALLENGE 14 MediumWorkshop Board โ Character Counter
Core Skill: Character Frequency
View Challenge โ
Workshop Board โ Character Counter
Workshop Board needs a reliable Python utility. Read a text line and then one character. Print how many times that exact character occurs.
๐ฏ Your Task
Read a text line and then one character. Print how many times that exact character occurs.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The character input contains exactly one character; matching is case-sensitive.
CodeBhavya o
Count = 1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
character = input()
print("Count =", text.count(character))CHALLENGE 15 MediumCareer Console โ Longest Word Finder
Core Skill: Word Processing
View Challenge โ
Career Console โ Longest Word Finder
Career Console needs a reliable Python utility. Read a sentence and print its longest word. If several words tie, print the first one.
๐ฏ Your Task
Read a sentence and print its longest word. If several words tie, print the first one.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence contains at least one word and at most 1000 characters.
small clear functions
Longest = functions
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
print("Longest =", max(words, key=len))CHALLENGE 16 HardResearch Desk โ Vowel Frequency
Core Skill: String Traversal
View Challenge โ
Research Desk โ Vowel Frequency
Research Desk needs a reliable Python utility. Read one line of text and count its vowels without treating uppercase and lowercase differently.
๐ฏ Your Task
Read one line of text and count its vowels without treating uppercase and lowercase differently.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains at most 1000 characters.
AEIOU rhythm
Vowels = 5
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input().lower()
count = 0
for character in text:
if character in "aeiou":
count += 1
print("Vowels =", count)CHALLENGE 17 HardChallenge Arena โ Normalised Palindrome
Core Skill: String Normalisation and Slicing
View Challenge โ
Challenge Arena โ Normalised Palindrome
Challenge Arena needs a reliable Python utility. Read a phrase and determine whether it is a palindrome after ignoring spaces, punctuation and letter case.
๐ฏ Your Task
Read a phrase and determine whether it is a palindrome after ignoring spaces, punctuation and letter case.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The phrase contains at most 1000 characters.
Was it a rat I saw
Palindrome
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
cleaned = "".join(character.lower() for character in text if character.isalnum())
print("Palindrome" if cleaned == cleaned[::-1] else "Not Palindrome")CHALLENGE 18 HardRevision Room โ Reverse Word Order
Core Skill: split(), Slicing and join()
View Challenge โ
Revision Room โ Reverse Word Order
Revision Room needs a reliable Python utility. Read a sentence and print its words in reverse order without reversing the letters inside each word.
๐ฏ Your Task
Read a sentence and print its words in reverse order without reversing the letters inside each word.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence has 1 to 100 whitespace-separated words.
clean code grows well
well grows code clean
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
sentence = input()
words = sentence.split()
print(" ".join(words[::-1]))CHALLENGE 19 HardInterview Lab โ Character Counter
Core Skill: Character Frequency
View Challenge โ
Interview Lab โ Character Counter
Interview Lab needs a reliable Python utility. Read a text line and then one character. Print how many times that exact character occurs.
๐ฏ Your Task
Read a text line and then one character. Print how many times that exact character occurs.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The character input contains exactly one character; matching is case-sensitive.
assessment s
Count = 4
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
character = input()
print("Count =", text.count(character))CHALLENGE 20 HardCodeBhavya Hub โ Longest Word Finder
Core Skill: Word Processing
View Challenge โ
CodeBhavya Hub โ Longest Word Finder
CodeBhavya Hub needs a reliable Python utility. Read a sentence and print its longest word. If several words tie, print the first one.
๐ฏ Your Task
Read a sentence and print its longest word. If several words tie, print the first one.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence contains at least one word and at most 1000 characters.
practice creates confidence
Longest = confidence
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
print("Longest =", max(words, key=len))Level 7 โ Lists, Tuples & SetsSequence processing, uniqueness and set operations. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Even Value Collector
Core Skill: List Traversal and Filtering
View Challenge โ
Orientation Desk โ Even Value Collector
Orientation Desk needs a reliable Python utility. Read space-separated integers, print the even values in their original order, then print their sum.
๐ฏ Your Task
Read space-separated integers, print the even values in their original order, then print their sum.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 200 integers.
1 2 3 4 5 6
2 4 6 Sum = 12
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
even_numbers = [number for number in numbers if number % 2 == 0]
print(*even_numbers)
print("Sum =", sum(even_numbers))CHALLENGE 02 EasyCampus Portal โ Second Largest Distinct
Core Skill: Lists, Sets and Sorting
View Challenge โ
Campus Portal โ Second Largest Distinct
Campus Portal needs a reliable Python utility. Read at least two distinct integers and print the second-largest distinct value.
๐ฏ Your Task
Read at least two distinct integers and print the second-largest distinct value.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
2 to 200 integers; at least two distinct values are guaranteed.
5 1 9 9 7
Second Largest = 7
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
unique = sorted(set(numbers), reverse=True)
print("Second Largest =", unique[1])CHALLENGE 03 EasyLearning Studio โ Ordered Duplicate Remover
Core Skill: Order-Preserving List Logic
View Challenge โ
Learning Studio โ Ordered Duplicate Remover
Learning Studio needs a reliable Python utility. Read integers and print only the first occurrence of each value while preserving the original order.
๐ฏ Your Task
Read integers and print only the first occurrence of each value while preserving the original order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 500 integers.
3 1 3 2 1 5
3 1 2 5
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
unique = []
for number in numbers:
if number not in unique:
unique.append(number)
print(*unique)CHALLENGE 04 EasySkill Tracker โ Common Unique Values
Core Skill: Set Intersection
View Challenge โ
Skill Tracker โ Common Unique Values
Skill Tracker needs a reliable Python utility. Read two lines of integers and print their common distinct values in ascending order.
๐ฏ Your Task
Read two lines of integers and print their common distinct values in ascending order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each line contains 1 to 200 integers.
1 2 2 3 2 3 4
2 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = set(map(int, input().split()))
second = set(map(int, input().split()))
print(*sorted(first & second))CHALLENGE 05 EasyMentor Console โ Tuple Statistics
Core Skill: Tuple Aggregation
View Challenge โ
Mentor Console โ Tuple Statistics
Mentor Console needs a reliable Python utility. Read integers, store them as a tuple and display minimum, maximum and average.
๐ฏ Your Task
Read integers, store them as a tuple and display minimum, maximum and average.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 200 integers.
10 20 30 40
Min = 10 Max = 40 Average = 25.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
values = tuple(map(int, input().split()))
print("Min =", min(values))
print("Max =", max(values))
print(f"Average = {sum(values) / len(values):.2f}")CHALLENGE 06 MediumLibrary Counter โ Even Value Collector
Core Skill: List Traversal and Filtering
View Challenge โ
Library Counter โ Even Value Collector
Library Counter needs a reliable Python utility. Read space-separated integers, print the even values in their original order, then print their sum.
๐ฏ Your Task
Read space-separated integers, print the even values in their original order, then print their sum.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 200 integers.
8 11 14 17 20
8 14 20 Sum = 42
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
even_numbers = [number for number in numbers if number % 2 == 0]
print(*even_numbers)
print("Sum =", sum(even_numbers))CHALLENGE 07 MediumPractice Lab โ Second Largest Distinct
Core Skill: Lists, Sets and Sorting
View Challenge โ
Practice Lab โ Second Largest Distinct
Practice Lab needs a reliable Python utility. Read at least two distinct integers and print the second-largest distinct value.
๐ฏ Your Task
Read at least two distinct integers and print the second-largest distinct value.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
2 to 200 integers; at least two distinct values are guaranteed.
20 10 30 25
Second Largest = 25
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
unique = sorted(set(numbers), reverse=True)
print("Second Largest =", unique[1])CHALLENGE 08 MediumQuiz Engine โ Ordered Duplicate Remover
Core Skill: Order-Preserving List Logic
View Challenge โ
Quiz Engine โ Ordered Duplicate Remover
Quiz Engine needs a reliable Python utility. Read integers and print only the first occurrence of each value while preserving the original order.
๐ฏ Your Task
Read integers and print only the first occurrence of each value while preserving the original order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 500 integers.
4 4 4 2 2 9
4 2 9
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
unique = []
for number in numbers:
if number not in unique:
unique.append(number)
print(*unique)CHALLENGE 09 MediumProject Hub โ Common Unique Values
Core Skill: Set Intersection
View Challenge โ
Project Hub โ Common Unique Values
Project Hub needs a reliable Python utility. Read two lines of integers and print their common distinct values in ascending order.
๐ฏ Your Task
Read two lines of integers and print their common distinct values in ascending order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each line contains 1 to 200 integers.
5 8 9 1 5 9
5 9
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = set(map(int, input().split()))
second = set(map(int, input().split()))
print(*sorted(first & second))CHALLENGE 10 MediumPlacement Desk โ Tuple Statistics
Core Skill: Tuple Aggregation
View Challenge โ
Placement Desk โ Tuple Statistics
Placement Desk needs a reliable Python utility. Read integers, store them as a tuple and display minimum, maximum and average.
๐ฏ Your Task
Read integers, store them as a tuple and display minimum, maximum and average.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 200 integers.
5 8 11
Min = 5 Max = 11 Average = 8.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
values = tuple(map(int, input().split()))
print("Min =", min(values))
print("Max =", max(values))
print(f"Average = {sum(values) / len(values):.2f}")CHALLENGE 11 MediumTeam Dashboard โ Even Value Collector
Core Skill: List Traversal and Filtering
View Challenge โ
Team Dashboard โ Even Value Collector
Team Dashboard needs a reliable Python utility. Read space-separated integers, print the even values in their original order, then print their sum.
๐ฏ Your Task
Read space-separated integers, print the even values in their original order, then print their sum.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 200 integers.
2 2 2 3
2 2 2 Sum = 6
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
even_numbers = [number for number in numbers if number % 2 == 0]
print(*even_numbers)
print("Sum =", sum(even_numbers))CHALLENGE 12 MediumData Centre โ Second Largest Distinct
Core Skill: Lists, Sets and Sorting
View Challenge โ
Data Centre โ Second Largest Distinct
Data Centre needs a reliable Python utility. Read at least two distinct integers and print the second-largest distinct value.
๐ฏ Your Task
Read at least two distinct integers and print the second-largest distinct value.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
2 to 200 integers; at least two distinct values are guaranteed.
4 4 3 2
Second Largest = 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
unique = sorted(set(numbers), reverse=True)
print("Second Largest =", unique[1])CHALLENGE 13 MediumStudent Vault โ Ordered Duplicate Remover
Core Skill: Order-Preserving List Logic
View Challenge โ
Student Vault โ Ordered Duplicate Remover
Student Vault needs a reliable Python utility. Read integers and print only the first occurrence of each value while preserving the original order.
๐ฏ Your Task
Read integers and print only the first occurrence of each value while preserving the original order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 500 integers.
1 2 3 1 2 4
1 2 3 4
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
unique = []
for number in numbers:
if number not in unique:
unique.append(number)
print(*unique)CHALLENGE 14 MediumWorkshop Board โ Common Unique Values
Core Skill: Set Intersection
View Challenge โ
Workshop Board โ Common Unique Values
Workshop Board needs a reliable Python utility. Read two lines of integers and print their common distinct values in ascending order.
๐ฏ Your Task
Read two lines of integers and print their common distinct values in ascending order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each line contains 1 to 200 integers.
10 20 30 40
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = set(map(int, input().split()))
second = set(map(int, input().split()))
print(*sorted(first & second))CHALLENGE 15 MediumCareer Console โ Tuple Statistics
Core Skill: Tuple Aggregation
View Challenge โ
Career Console โ Tuple Statistics
Career Console needs a reliable Python utility. Read integers, store them as a tuple and display minimum, maximum and average.
๐ฏ Your Task
Read integers, store them as a tuple and display minimum, maximum and average.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 200 integers.
100 50 75
Min = 50 Max = 100 Average = 75.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
values = tuple(map(int, input().split()))
print("Min =", min(values))
print("Max =", max(values))
print(f"Average = {sum(values) / len(values):.2f}")CHALLENGE 16 HardResearch Desk โ Even Value Collector
Core Skill: List Traversal and Filtering
View Challenge โ
Research Desk โ Even Value Collector
Research Desk needs a reliable Python utility. Read space-separated integers, print the even values in their original order, then print their sum.
๐ฏ Your Task
Read space-separated integers, print the even values in their original order, then print their sum.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 200 integers.
9 12 15 18 21
12 18 Sum = 30
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
even_numbers = [number for number in numbers if number % 2 == 0]
print(*even_numbers)
print("Sum =", sum(even_numbers))CHALLENGE 17 HardChallenge Arena โ Second Largest Distinct
Core Skill: Lists, Sets and Sorting
View Challenge โ
Challenge Arena โ Second Largest Distinct
Challenge Arena needs a reliable Python utility. Read at least two distinct integers and print the second-largest distinct value.
๐ฏ Your Task
Read at least two distinct integers and print the second-largest distinct value.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
2 to 200 integers; at least two distinct values are guaranteed.
100 50 75 100
Second Largest = 75
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
unique = sorted(set(numbers), reverse=True)
print("Second Largest =", unique[1])CHALLENGE 18 HardRevision Room โ Ordered Duplicate Remover
Core Skill: Order-Preserving List Logic
View Challenge โ
Revision Room โ Ordered Duplicate Remover
Revision Room needs a reliable Python utility. Read integers and print only the first occurrence of each value while preserving the original order.
๐ฏ Your Task
Read integers and print only the first occurrence of each value while preserving the original order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 500 integers.
7 5 7 5 3
7 5 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
unique = []
for number in numbers:
if number not in unique:
unique.append(number)
print(*unique)CHALLENGE 19 HardInterview Lab โ Common Unique Values
Core Skill: Set Intersection
View Challenge โ
Interview Lab โ Common Unique Values
Interview Lab needs a reliable Python utility. Read two lines of integers and print their common distinct values in ascending order.
๐ฏ Your Task
Read two lines of integers and print their common distinct values in ascending order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Each line contains 1 to 200 integers.
3 6 9 12 6 12 18
6 12
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first = set(map(int, input().split()))
second = set(map(int, input().split()))
print(*sorted(first & second))CHALLENGE 20 HardCodeBhavya Hub โ Tuple Statistics
Core Skill: Tuple Aggregation
View Challenge โ
CodeBhavya Hub โ Tuple Statistics
CodeBhavya Hub needs a reliable Python utility. Read integers, store them as a tuple and display minimum, maximum and average.
๐ฏ Your Task
Read integers, store them as a tuple and display minimum, maximum and average.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 200 integers.
2 4 6 8 10
Min = 2 Max = 10 Average = 6.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
values = tuple(map(int, input().split()))
print("Min =", min(values))
print("Max =", max(values))
print(f"Average = {sum(values) / len(values):.2f}")Level 8 โ DictionariesCounting, lookup, grouping and record processing. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Sorted Word Frequency
Core Skill: Dictionary Counting
View Challenge โ
Orientation Desk โ Sorted Word Frequency
Orientation Desk needs a reliable Python utility. Read a sentence, count each lowercase word and print word:count lines in alphabetical order.
๐ฏ Your Task
Read a sentence, count each lowercase word and print word:count lines in alphabetical order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence contains 1 to 200 whitespace-separated words.
learn build learn
build:1 learn:2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().lower().split()
frequency = {}
for word in words:
frequency[word] = frequency.get(word, 0) + 1
for word in sorted(frequency):
print(f"{word}:{frequency[word]}")CHALLENGE 02 EasyCampus Portal โ Highest Scoring Student
Core Skill: Dictionary Records
View Challenge โ
Campus Portal โ Highest Scoring Student
Campus Portal needs a reliable Python utility. Read n name-score records and print the name and mark of the first highest-scoring student.
๐ฏ Your Task
Read n name-score records and print the name and mark of the first highest-scoring student.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100; names contain no spaces; 0 โค score โค 100.
3 Asha 82 Ravi 75 Bhavya 91
Bhavya 91
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
scores = {}
order = []
for _ in range(n):
name, mark = input().split()
scores[name] = int(mark)
order.append(name)
best = max(order, key=scores.get)
print(best, scores[best])CHALLENGE 03 EasyLearning Studio โ Dictionary Merger
Core Skill: Dictionary Update
View Challenge โ
Learning Studio โ Dictionary Merger
Learning Studio needs a reliable Python utility. Read two key=value lines, merge them so the second line overrides duplicate keys, and print sorted key=value pairs.
๐ฏ Your Task
Read two key=value lines, merge them so the second line overrides duplicate keys, and print sorted key=value pairs.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Keys are single words; values are integers; each line has at least one pair.
a=1 b=2 b=5 c=3
a=1 b=5 c=3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first_line = input().split()
second_line = input().split()
merged = {}
for item in first_line + second_line:
key, value = item.split("=")
merged[key] = int(value)
print(" ".join(f"{key}={merged[key]}" for key in sorted(merged)))CHALLENGE 04 EasySkill Tracker โ First-Letter Groups
Core Skill: Grouping with Dictionaries
View Challenge โ
Skill Tracker โ First-Letter Groups
Skill Tracker needs a reliable Python utility. Read words and group them by first letter. Print groups in key order as letter:word,word.
๐ฏ Your Task
Read words and group them by first letter. Print groups in key order as letter:word,word.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Words contain letters only and the line has at most 100 words.
apple ant ball boat
a:apple,ant b:ball,boat
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
groups = {}
for word in words:
key = word[0].lower()
groups.setdefault(key, []).append(word)
for key in sorted(groups):
print(f"{key}:{','.join(groups[key])}")CHALLENGE 05 EasyMentor Console โ Inventory Lookup
Core Skill: Dictionary Lookup
View Challenge โ
Mentor Console โ Inventory Lookup
Mentor Console needs a reliable Python utility. Read n item-quantity records and a query item. Print its available quantity or Not Found.
๐ฏ Your Task
Read n item-quantity records and a query item. Print its available quantity or Not Found.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100; item names contain no spaces; quantities are non-negative integers.
3 pen 12 book 5 bag 2 book
Available = 5
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
inventory = {}
for _ in range(n):
item, quantity = input().split()
inventory[item] = int(quantity)
query = input()
if query in inventory:
print("Available =", inventory[query])
else:
print("Not Found")CHALLENGE 06 MediumLibrary Counter โ Sorted Word Frequency
Core Skill: Dictionary Counting
View Challenge โ
Library Counter โ Sorted Word Frequency
Library Counter needs a reliable Python utility. Read a sentence, count each lowercase word and print word:count lines in alphabetical order.
๐ฏ Your Task
Read a sentence, count each lowercase word and print word:count lines in alphabetical order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence contains 1 to 200 whitespace-separated words.
python code python test
code:1 python:2 test:1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().lower().split()
frequency = {}
for word in words:
frequency[word] = frequency.get(word, 0) + 1
for word in sorted(frequency):
print(f"{word}:{frequency[word]}")CHALLENGE 07 MediumPractice Lab โ Highest Scoring Student
Core Skill: Dictionary Records
View Challenge โ
Practice Lab โ Highest Scoring Student
Practice Lab needs a reliable Python utility. Read n name-score records and print the name and mark of the first highest-scoring student.
๐ฏ Your Task
Read n name-score records and print the name and mark of the first highest-scoring student.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100; names contain no spaces; 0 โค score โค 100.
4 Dev 60 Isha 88 Kiran 79 Meera 95
Meera 95
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
scores = {}
order = []
for _ in range(n):
name, mark = input().split()
scores[name] = int(mark)
order.append(name)
best = max(order, key=scores.get)
print(best, scores[best])CHALLENGE 08 MediumQuiz Engine โ Dictionary Merger
Core Skill: Dictionary Update
View Challenge โ
Quiz Engine โ Dictionary Merger
Quiz Engine needs a reliable Python utility. Read two key=value lines, merge them so the second line overrides duplicate keys, and print sorted key=value pairs.
๐ฏ Your Task
Read two key=value lines, merge them so the second line overrides duplicate keys, and print sorted key=value pairs.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Keys are single words; values are integers; each line has at least one pair.
x=10 y=20 z=30
x=10 y=20 z=30
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first_line = input().split()
second_line = input().split()
merged = {}
for item in first_line + second_line:
key, value = item.split("=")
merged[key] = int(value)
print(" ".join(f"{key}={merged[key]}" for key in sorted(merged)))CHALLENGE 09 MediumProject Hub โ First-Letter Groups
Core Skill: Grouping with Dictionaries
View Challenge โ
Project Hub โ First-Letter Groups
Project Hub needs a reliable Python utility. Read words and group them by first letter. Print groups in key order as letter:word,word.
๐ฏ Your Task
Read words and group them by first letter. Print groups in key order as letter:word,word.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Words contain letters only and the line has at most 100 words.
cat car dog deer
c:cat,car d:dog,deer
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
groups = {}
for word in words:
key = word[0].lower()
groups.setdefault(key, []).append(word)
for key in sorted(groups):
print(f"{key}:{','.join(groups[key])}")CHALLENGE 10 MediumPlacement Desk โ Inventory Lookup
Core Skill: Dictionary Lookup
View Challenge โ
Placement Desk โ Inventory Lookup
Placement Desk needs a reliable Python utility. Read n item-quantity records and a query item. Print its available quantity or Not Found.
๐ฏ Your Task
Read n item-quantity records and a query item. Print its available quantity or Not Found.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100; item names contain no spaces; quantities are non-negative integers.
2 mouse 7 keyboard 4 monitor
Not Found
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
inventory = {}
for _ in range(n):
item, quantity = input().split()
inventory[item] = int(quantity)
query = input()
if query in inventory:
print("Available =", inventory[query])
else:
print("Not Found")CHALLENGE 11 MediumTeam Dashboard โ Sorted Word Frequency
Core Skill: Dictionary Counting
View Challenge โ
Team Dashboard โ Sorted Word Frequency
Team Dashboard needs a reliable Python utility. Read a sentence, count each lowercase word and print word:count lines in alphabetical order.
๐ฏ Your Task
Read a sentence, count each lowercase word and print word:count lines in alphabetical order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence contains 1 to 200 whitespace-separated words.
red blue red green blue
blue:2 green:1 red:2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().lower().split()
frequency = {}
for word in words:
frequency[word] = frequency.get(word, 0) + 1
for word in sorted(frequency):
print(f"{word}:{frequency[word]}")CHALLENGE 12 MediumData Centre โ Highest Scoring Student
Core Skill: Dictionary Records
View Challenge โ
Data Centre โ Highest Scoring Student
Data Centre needs a reliable Python utility. Read n name-score records and print the name and mark of the first highest-scoring student.
๐ฏ Your Task
Read n name-score records and print the name and mark of the first highest-scoring student.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100; names contain no spaces; 0 โค score โค 100.
2 Ana 70 Ben 65
Ana 70
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
scores = {}
order = []
for _ in range(n):
name, mark = input().split()
scores[name] = int(mark)
order.append(name)
best = max(order, key=scores.get)
print(best, scores[best])CHALLENGE 13 MediumStudent Vault โ Dictionary Merger
Core Skill: Dictionary Update
View Challenge โ
Student Vault โ Dictionary Merger
Student Vault needs a reliable Python utility. Read two key=value lines, merge them so the second line overrides duplicate keys, and print sorted key=value pairs.
๐ฏ Your Task
Read two key=value lines, merge them so the second line overrides duplicate keys, and print sorted key=value pairs.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Keys are single words; values are integers; each line has at least one pair.
red=2 blue=4 blue=7 green=1
blue=7 green=1 red=2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first_line = input().split()
second_line = input().split()
merged = {}
for item in first_line + second_line:
key, value = item.split("=")
merged[key] = int(value)
print(" ".join(f"{key}={merged[key]}" for key in sorted(merged)))CHALLENGE 14 MediumWorkshop Board โ First-Letter Groups
Core Skill: Grouping with Dictionaries
View Challenge โ
Workshop Board โ First-Letter Groups
Workshop Board needs a reliable Python utility. Read words and group them by first letter. Print groups in key order as letter:word,word.
๐ฏ Your Task
Read words and group them by first letter. Print groups in key order as letter:word,word.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Words contain letters only and the line has at most 100 words.
python practice build better
b:build,better p:python,practice
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
groups = {}
for word in words:
key = word[0].lower()
groups.setdefault(key, []).append(word)
for key in sorted(groups):
print(f"{key}:{','.join(groups[key])}")CHALLENGE 15 MediumCareer Console โ Inventory Lookup
Core Skill: Dictionary Lookup
View Challenge โ
Career Console โ Inventory Lookup
Career Console needs a reliable Python utility. Read n item-quantity records and a query item. Print its available quantity or Not Found.
๐ฏ Your Task
Read n item-quantity records and a query item. Print its available quantity or Not Found.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100; item names contain no spaces; quantities are non-negative integers.
4 apple 9 banana 6 mango 3 grape 8 mango
Available = 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
inventory = {}
for _ in range(n):
item, quantity = input().split()
inventory[item] = int(quantity)
query = input()
if query in inventory:
print("Available =", inventory[query])
else:
print("Not Found")CHALLENGE 16 HardResearch Desk โ Sorted Word Frequency
Core Skill: Dictionary Counting
View Challenge โ
Research Desk โ Sorted Word Frequency
Research Desk needs a reliable Python utility. Read a sentence, count each lowercase word and print word:count lines in alphabetical order.
๐ฏ Your Task
Read a sentence, count each lowercase word and print word:count lines in alphabetical order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The sentence contains 1 to 200 whitespace-separated words.
data drives decisions data
data:2 decisions:1 drives:1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().lower().split()
frequency = {}
for word in words:
frequency[word] = frequency.get(word, 0) + 1
for word in sorted(frequency):
print(f"{word}:{frequency[word]}")CHALLENGE 17 HardChallenge Arena โ Highest Scoring Student
Core Skill: Dictionary Records
View Challenge โ
Challenge Arena โ Highest Scoring Student
Challenge Arena needs a reliable Python utility. Read n name-score records and print the name and mark of the first highest-scoring student.
๐ฏ Your Task
Read n name-score records and print the name and mark of the first highest-scoring student.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100; names contain no spaces; 0 โค score โค 100.
3 Pia 99 Raj 98 Sam 97
Pia 99
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
scores = {}
order = []
for _ in range(n):
name, mark = input().split()
scores[name] = int(mark)
order.append(name)
best = max(order, key=scores.get)
print(best, scores[best])CHALLENGE 18 HardRevision Room โ Dictionary Merger
Core Skill: Dictionary Update
View Challenge โ
Revision Room โ Dictionary Merger
Revision Room needs a reliable Python utility. Read two key=value lines, merge them so the second line overrides duplicate keys, and print sorted key=value pairs.
๐ฏ Your Task
Read two key=value lines, merge them so the second line overrides duplicate keys, and print sorted key=value pairs.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Keys are single words; values are integers; each line has at least one pair.
p=9 q=8 p=1 r=6
p=1 q=8 r=6
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
first_line = input().split()
second_line = input().split()
merged = {}
for item in first_line + second_line:
key, value = item.split("=")
merged[key] = int(value)
print(" ".join(f"{key}={merged[key]}" for key in sorted(merged)))CHALLENGE 19 HardInterview Lab โ First-Letter Groups
Core Skill: Grouping with Dictionaries
View Challenge โ
Interview Lab โ First-Letter Groups
Interview Lab needs a reliable Python utility. Read words and group them by first letter. Print groups in key order as letter:word,word.
๐ฏ Your Task
Read words and group them by first letter. Print groups in key order as letter:word,word.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Words contain letters only and the line has at most 100 words.
sun star moon map
m:moon,map s:sun,star
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
groups = {}
for word in words:
key = word[0].lower()
groups.setdefault(key, []).append(word)
for key in sorted(groups):
print(f"{key}:{','.join(groups[key])}")CHALLENGE 20 HardCodeBhavya Hub โ Inventory Lookup
Core Skill: Dictionary Lookup
View Challenge โ
CodeBhavya Hub โ Inventory Lookup
CodeBhavya Hub needs a reliable Python utility. Read n item-quantity records and a query item. Print its available quantity or Not Found.
๐ฏ Your Task
Read n item-quantity records and a query item. Print its available quantity or Not Found.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100; item names contain no spaces; quantities are non-negative integers.
1 python 100 python
Available = 100
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
n = int(input())
inventory = {}
for _ in range(n):
item, quantity = input().split()
inventory[item] = int(quantity)
query = input()
if query in inventory:
print("Available =", inventory[query])
else:
print("Not Found")Level 9 โ Functions & RecursionReusable functions, recursion and structured decomposition. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Reusable Digit Sum
Core Skill: Function Definition and Return
View Challenge โ
Orientation Desk โ Reusable Digit Sum
Orientation Desk needs a reliable Python utility. Define digit_sum(number), read a positive integer and print the returned digit sum.
๐ฏ Your Task
Define digit_sum(number), read a positive integer and print the returned digit sum.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค number โค 10^18.
48271
Digit Sum = 22
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def digit_sum(number):
total = 0
for digit in str(number):
total += int(digit)
return total
number = int(input())
print("Digit Sum =", digit_sum(number))CHALLENGE 02 EasyCampus Portal โ Recursive Factorial
Core Skill: Base Case and Recursive Return
View Challenge โ
Campus Portal โ Recursive Factorial
Campus Portal needs a reliable Python utility. Define a recursive factorial(n), read n and print its factorial.
๐ฏ Your Task
Define a recursive factorial(n), read n and print its factorial.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 20.
5
Factorial = 120
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def factorial(n):
if n < 2:
return 1
return n * factorial(n - 1)
n = int(input())
print("Factorial =", factorial(n))CHALLENGE 03 EasyLearning Studio โ Recursive Fibonacci
Core Skill: Recursive Decomposition
View Challenge โ
Learning Studio โ Recursive Fibonacci
Learning Studio needs a reliable Python utility. Define fibonacci(n), using F(0)=0 and F(1)=1, then print F(n).
๐ฏ Your Task
Define fibonacci(n), using F(0)=0 and F(1)=1, then print F(n).
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 30.
7
Fibonacci = 13
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def fibonacci(n):
if n < 2:
return n
return fibonacci(n - 1) + fibonacci(n - 2)
n = int(input())
print("Fibonacci =", fibonacci(n))CHALLENGE 04 EasySkill Tracker โ Variable-Length Average
Core Skill: Arbitrary Argument Functions
View Challenge โ
Skill Tracker โ Variable-Length Average
Skill Tracker needs a reliable Python utility. Define average(*values), read space-separated numbers and print their average to two decimal places.
๐ฏ Your Task
Define average(*values), read space-separated numbers and print their average to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 100 numbers.
1 2 3 4
Average = 2.50
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def average(*values):
return sum(values) / len(values)
numbers = list(map(float, input().split()))
print(f"Average = {average(*numbers):.2f}")CHALLENGE 05 EasyMentor Console โ Prime Function
Core Skill: Reusable Boolean Function
View Challenge โ
Mentor Console โ Prime Function
Mentor Console needs a reliable Python utility. Define is_prime(n), read an integer and print Prime or Not Prime.
๐ฏ Your Task
Define is_prime(n), read an integer and print Prime or Not Prime.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 10^9.
29
Prime
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def is_prime(number):
if number < 2:
return False
divisor = 2
while divisor * divisor <= number:
if number % divisor == 0:
return False
divisor += 1
return True
number = int(input())
print("Prime" if is_prime(number) else "Not Prime")CHALLENGE 06 MediumLibrary Counter โ Reusable Digit Sum
Core Skill: Function Definition and Return
View Challenge โ
Library Counter โ Reusable Digit Sum
Library Counter needs a reliable Python utility. Define digit_sum(number), read a positive integer and print the returned digit sum.
๐ฏ Your Task
Define digit_sum(number), read a positive integer and print the returned digit sum.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค number โค 10^18.
999
Digit Sum = 27
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def digit_sum(number):
total = 0
for digit in str(number):
total += int(digit)
return total
number = int(input())
print("Digit Sum =", digit_sum(number))CHALLENGE 07 MediumPractice Lab โ Recursive Factorial
Core Skill: Base Case and Recursive Return
View Challenge โ
Practice Lab โ Recursive Factorial
Practice Lab needs a reliable Python utility. Define a recursive factorial(n), read n and print its factorial.
๐ฏ Your Task
Define a recursive factorial(n), read n and print its factorial.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 20.
6
Factorial = 720
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def factorial(n):
if n < 2:
return 1
return n * factorial(n - 1)
n = int(input())
print("Factorial =", factorial(n))CHALLENGE 08 MediumQuiz Engine โ Recursive Fibonacci
Core Skill: Recursive Decomposition
View Challenge โ
Quiz Engine โ Recursive Fibonacci
Quiz Engine needs a reliable Python utility. Define fibonacci(n), using F(0)=0 and F(1)=1, then print F(n).
๐ฏ Your Task
Define fibonacci(n), using F(0)=0 and F(1)=1, then print F(n).
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 30.
8
Fibonacci = 21
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def fibonacci(n):
if n < 2:
return n
return fibonacci(n - 1) + fibonacci(n - 2)
n = int(input())
print("Fibonacci =", fibonacci(n))CHALLENGE 09 MediumProject Hub โ Variable-Length Average
Core Skill: Arbitrary Argument Functions
View Challenge โ
Project Hub โ Variable-Length Average
Project Hub needs a reliable Python utility. Define average(*values), read space-separated numbers and print their average to two decimal places.
๐ฏ Your Task
Define average(*values), read space-separated numbers and print their average to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 100 numbers.
10 20 30
Average = 20.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def average(*values):
return sum(values) / len(values)
numbers = list(map(float, input().split()))
print(f"Average = {average(*numbers):.2f}")CHALLENGE 10 MediumPlacement Desk โ Prime Function
Core Skill: Reusable Boolean Function
View Challenge โ
Placement Desk โ Prime Function
Placement Desk needs a reliable Python utility. Define is_prime(n), read an integer and print Prime or Not Prime.
๐ฏ Your Task
Define is_prime(n), read an integer and print Prime or Not Prime.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 10^9.
35
Not Prime
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def is_prime(number):
if number < 2:
return False
divisor = 2
while divisor * divisor <= number:
if number % divisor == 0:
return False
divisor += 1
return True
number = int(input())
print("Prime" if is_prime(number) else "Not Prime")CHALLENGE 11 MediumTeam Dashboard โ Reusable Digit Sum
Core Skill: Function Definition and Return
View Challenge โ
Team Dashboard โ Reusable Digit Sum
Team Dashboard needs a reliable Python utility. Define digit_sum(number), read a positive integer and print the returned digit sum.
๐ฏ Your Task
Define digit_sum(number), read a positive integer and print the returned digit sum.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค number โค 10^18.
12003
Digit Sum = 6
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def digit_sum(number):
total = 0
for digit in str(number):
total += int(digit)
return total
number = int(input())
print("Digit Sum =", digit_sum(number))CHALLENGE 12 MediumData Centre โ Recursive Factorial
Core Skill: Base Case and Recursive Return
View Challenge โ
Data Centre โ Recursive Factorial
Data Centre needs a reliable Python utility. Define a recursive factorial(n), read n and print its factorial.
๐ฏ Your Task
Define a recursive factorial(n), read n and print its factorial.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 20.
7
Factorial = 5040
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def factorial(n):
if n < 2:
return 1
return n * factorial(n - 1)
n = int(input())
print("Factorial =", factorial(n))CHALLENGE 13 MediumStudent Vault โ Recursive Fibonacci
Core Skill: Recursive Decomposition
View Challenge โ
Student Vault โ Recursive Fibonacci
Student Vault needs a reliable Python utility. Define fibonacci(n), using F(0)=0 and F(1)=1, then print F(n).
๐ฏ Your Task
Define fibonacci(n), using F(0)=0 and F(1)=1, then print F(n).
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 30.
9
Fibonacci = 34
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def fibonacci(n):
if n < 2:
return n
return fibonacci(n - 1) + fibonacci(n - 2)
n = int(input())
print("Fibonacci =", fibonacci(n))CHALLENGE 14 MediumWorkshop Board โ Variable-Length Average
Core Skill: Arbitrary Argument Functions
View Challenge โ
Workshop Board โ Variable-Length Average
Workshop Board needs a reliable Python utility. Define average(*values), read space-separated numbers and print their average to two decimal places.
๐ฏ Your Task
Define average(*values), read space-separated numbers and print their average to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 100 numbers.
5 8 11
Average = 8.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def average(*values):
return sum(values) / len(values)
numbers = list(map(float, input().split()))
print(f"Average = {average(*numbers):.2f}")CHALLENGE 15 MediumCareer Console โ Prime Function
Core Skill: Reusable Boolean Function
View Challenge โ
Career Console โ Prime Function
Career Console needs a reliable Python utility. Define is_prime(n), read an integer and print Prime or Not Prime.
๐ฏ Your Task
Define is_prime(n), read an integer and print Prime or Not Prime.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 10^9.
2
Prime
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def is_prime(number):
if number < 2:
return False
divisor = 2
while divisor * divisor <= number:
if number % divisor == 0:
return False
divisor += 1
return True
number = int(input())
print("Prime" if is_prime(number) else "Not Prime")CHALLENGE 16 HardResearch Desk โ Reusable Digit Sum
Core Skill: Function Definition and Return
View Challenge โ
Research Desk โ Reusable Digit Sum
Research Desk needs a reliable Python utility. Define digit_sum(number), read a positive integer and print the returned digit sum.
๐ฏ Your Task
Define digit_sum(number), read a positive integer and print the returned digit sum.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค number โค 10^18.
80808
Digit Sum = 24
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def digit_sum(number):
total = 0
for digit in str(number):
total += int(digit)
return total
number = int(input())
print("Digit Sum =", digit_sum(number))CHALLENGE 17 HardChallenge Arena โ Recursive Factorial
Core Skill: Base Case and Recursive Return
View Challenge โ
Challenge Arena โ Recursive Factorial
Challenge Arena needs a reliable Python utility. Define a recursive factorial(n), read n and print its factorial.
๐ฏ Your Task
Define a recursive factorial(n), read n and print its factorial.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 20.
8
Factorial = 40320
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def factorial(n):
if n < 2:
return 1
return n * factorial(n - 1)
n = int(input())
print("Factorial =", factorial(n))CHALLENGE 18 HardRevision Room โ Recursive Fibonacci
Core Skill: Recursive Decomposition
View Challenge โ
Revision Room โ Recursive Fibonacci
Revision Room needs a reliable Python utility. Define fibonacci(n), using F(0)=0 and F(1)=1, then print F(n).
๐ฏ Your Task
Define fibonacci(n), using F(0)=0 and F(1)=1, then print F(n).
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 30.
10
Fibonacci = 55
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def fibonacci(n):
if n < 2:
return n
return fibonacci(n - 1) + fibonacci(n - 2)
n = int(input())
print("Fibonacci =", fibonacci(n))CHALLENGE 19 HardInterview Lab โ Variable-Length Average
Core Skill: Arbitrary Argument Functions
View Challenge โ
Interview Lab โ Variable-Length Average
Interview Lab needs a reliable Python utility. Define average(*values), read space-separated numbers and print their average to two decimal places.
๐ฏ Your Task
Define average(*values), read space-separated numbers and print their average to two decimal places.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 100 numbers.
2 4 6 8 10
Average = 6.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def average(*values):
return sum(values) / len(values)
numbers = list(map(float, input().split()))
print(f"Average = {average(*numbers):.2f}")CHALLENGE 20 HardCodeBhavya Hub โ Prime Function
Core Skill: Reusable Boolean Function
View Challenge โ
CodeBhavya Hub โ Prime Function
CodeBhavya Hub needs a reliable Python utility. Define is_prime(n), read an integer and print Prime or Not Prime.
๐ฏ Your Task
Define is_prime(n), read an integer and print Prime or Not Prime.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
0 โค n โค 10^9.
97
Prime
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
def is_prime(number):
if number < 2:
return False
divisor = 2
while divisor * divisor <= number:
if number % divisor == 0:
return False
divisor += 1
return True
number = int(input())
print("Prime" if is_prime(number) else "Not Prime")Level 10 โ Modules, Exceptions & FilesTwenty genuine local labs for persistent data workflows. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 EasyOrientation Desk โ Text File Writer
Core Skill: Create and Write a File
View Challenge โ
Orientation Desk โ Text File Writer
Orientation Desk needs a genuine local Python workflow. Read one line from the keyboard and store it in notes.txt.
๐ฏ Your Task
Read one line from the keyboard and store it in notes.txt.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
Learning Python files
Data written successfully
Show Program
text = input("Enter text: ")
with open("notes.txt", "w", encoding="utf-8") as file:
file.write(text)
print("Data written successfully")CHALLENGE 02 EasyCampus Portal โ Text File Reader
Core Skill: Read a Complete File
View Challenge โ
Campus Portal โ Text File Reader
Campus Portal needs a genuine local Python workflow. Read and display all text stored in notes.txt.
๐ฏ Your Task
Read and display all text stored in notes.txt.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
notes.txt contains: Learn Practice Build
Learn Practice Build
Show Program
with open("notes.txt", "r", encoding="utf-8") as file:
content = file.read()
print(content, end="")CHALLENGE 03 EasyLearning Studio โ Line Counter
Core Skill: Count File Lines
View Challenge โ
Learning Studio โ Line Counter
Learning Studio needs a genuine local Python workflow. Count the number of lines present in notes.txt.
๐ฏ Your Task
Count the number of lines present in notes.txt.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
notes.txt contains 5 lines
Lines = 5
Show Program
with open("notes.txt", "r", encoding="utf-8") as file:
line_count = sum(1 for _ in file)
print("Lines =", line_count)CHALLENGE 04 EasySkill Tracker โ Word Counter
Core Skill: Count File Words
View Challenge โ
Skill Tracker โ Word Counter
Skill Tracker needs a genuine local Python workflow. Count all whitespace-separated words in notes.txt.
๐ฏ Your Task
Count all whitespace-separated words in notes.txt.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
notes.txt contains: Python makes automation simple
Words = 4
Show Program
with open("notes.txt", "r", encoding="utf-8") as file:
words = file.read().split()
print("Words =", len(words))CHALLENGE 05 EasyMentor Console โ Character Counter
Core Skill: Count File Characters
View Challenge โ
Mentor Console โ Character Counter
Mentor Console needs a genuine local Python workflow. Count every character in notes.txt, including spaces and newlines.
๐ฏ Your Task
Count every character in notes.txt, including spaces and newlines.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
notes.txt contains: Python
Characters = 6
Show Program
with open("notes.txt", "r", encoding="utf-8") as file:
content = file.read()
print("Characters =", len(content))CHALLENGE 06 EasyLibrary Counter โ Safe File Copier
Core Skill: Copy One File to Another
View Challenge โ
Library Counter โ Safe File Copier
Library Counter needs a genuine local Python workflow. Copy the complete contents of source.txt into backup.txt.
๐ฏ Your Task
Copy the complete contents of source.txt into backup.txt.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
source.txt contains project notes
File copied successfully
Show Program
with open("source.txt", "r", encoding="utf-8") as source:
content = source.read()
with open("backup.txt", "w", encoding="utf-8") as destination:
destination.write(content)
print("File copied successfully")CHALLENGE 07 MediumPractice Lab โ Append Without Erasing
Core Skill: Append Mode
View Challenge โ
Practice Lab โ Append Without Erasing
Practice Lab needs a genuine local Python workflow. Read one line and append it to journal.txt without deleting old data.
๐ฏ Your Task
Read one line and append it to journal.txt without deleting old data.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
Completed Level 10
Entry appended
Show Program
entry = input("Enter entry: ")
with open("journal.txt", "a", encoding="utf-8") as file:
file.write(entry + "\n")
print("Entry appended")CHALLENGE 08 MediumQuiz Engine โ Keyword Finder
Core Skill: Search Text in a File
View Challenge โ
Quiz Engine โ Keyword Finder
Quiz Engine needs a genuine local Python workflow. Read a keyword and report whether it occurs in notes.txt, ignoring letter case.
๐ฏ Your Task
Read a keyword and report whether it occurs in notes.txt, ignoring letter case.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
python
Found
Show Program
keyword = input("Keyword: ").lower()
with open("notes.txt", "r", encoding="utf-8") as file:
content = file.read().lower()
print("Found" if keyword in content else "Not Found")CHALLENGE 09 MediumProject Hub โ Specific Character Frequency
Core Skill: Character Search in Files
View Challenge โ
Project Hub โ Specific Character Frequency
Project Hub needs a genuine local Python workflow. Read one character and count its exact occurrences in notes.txt.
๐ฏ Your Task
Read one character and count its exact occurrences in notes.txt.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
a
Count = 3
Show Program
character = input("Character: ")
with open("notes.txt", "r", encoding="utf-8") as file:
content = file.read()
print("Count =", content.count(character))CHALLENGE 10 MediumPlacement Desk โ Number Archive Writer
Core Skill: Store Numeric Data
View Challenge โ
Placement Desk โ Number Archive Writer
Placement Desk needs a genuine local Python workflow. Read space-separated integers and store one integer per line in numbers.txt.
๐ฏ Your Task
Read space-separated integers and store one integer per line in numbers.txt.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
10 20 30 40
Numbers stored successfully
Show Program
numbers = list(map(int, input("Numbers: ").split()))
with open("numbers.txt", "w", encoding="utf-8") as file:
file.write("\n".join(map(str, numbers)))
print("Numbers stored successfully")CHALLENGE 11 MediumTeam Dashboard โ Number Archive Sum
Core Skill: Read and Aggregate File Data
View Challenge โ
Team Dashboard โ Number Archive Sum
Team Dashboard needs a genuine local Python workflow. Read integers from numbers.txt and display their sum.
๐ฏ Your Task
Read integers from numbers.txt and display their sum.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
numbers.txt contains: 10 20 30
Sum = 60
Show Program
with open("numbers.txt", "r", encoding="utf-8") as file:
numbers = [int(line.strip()) for line in file if line.strip()]
print("Sum =", sum(numbers))CHALLENGE 12 MediumData Centre โ CSV Student Register
Core Skill: csv Module
View Challenge โ
Data Centre โ CSV Student Register
Data Centre needs a genuine local Python workflow. Write three name-and-score records into students.csv with a header row.
๐ฏ Your Task
Write three name-and-score records into students.csv with a header row.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
Asha 91 Ravi 84 Meera 95
CSV created
Show Program
import csv
records = [("Asha", 91), ("Ravi", 84), ("Meera", 95)]
with open("students.csv", "w", newline="", encoding="utf-8") as file:
writer = csv.writer(file)
writer.writerow(["name", "score"])
writer.writerows(records)
print("CSV created")CHALLENGE 13 MediumStudent Vault โ JSON Settings Vault
Core Skill: json Module
View Challenge โ
Student Vault โ JSON Settings Vault
Student Vault needs a genuine local Python workflow. Store a settings dictionary in settings.json and read it back.
๐ฏ Your Task
Store a settings dictionary in settings.json and read it back.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
theme=dark, language=Python
{'theme': 'dark', 'language': 'Python'}Show Program
import json
settings = {"theme": "dark", "language": "Python"}
with open("settings.json", "w", encoding="utf-8") as file:
json.dump(settings, file, indent=2)
with open("settings.json", "r", encoding="utf-8") as file:
loaded = json.load(file)
print(loaded)CHALLENGE 14 MediumWorkshop Board โ Missing File Guard
Core Skill: FileNotFoundError Handling
View Challenge โ
Workshop Board โ Missing File Guard
Workshop Board needs a genuine local Python workflow. Attempt to read report.txt and print a friendly message if it does not exist.
๐ฏ Your Task
Attempt to read report.txt and print a friendly message if it does not exist.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
report.txt is absent
File not found
Show Program
try:
with open("report.txt", "r", encoding="utf-8") as file:
print(file.read(), end="")
except FileNotFoundError:
print("File not found")CHALLENGE 15 MediumCareer Console โ Path Inspector
Core Skill: pathlib Module
View Challenge โ
Career Console โ Path Inspector
Career Console needs a genuine local Python workflow. Check whether data.txt exists and report File exists or File missing.
๐ฏ Your Task
Check whether data.txt exists and report File exists or File missing.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
Run inside a local project folder
File exists
Show Program
from pathlib import Path
path = Path("data.txt")
print("File exists" if path.exists() else "File missing")CHALLENGE 16 HardResearch Desk โ Extension Inventory
Core Skill: Directory Traversal
View Challenge โ
Research Desk โ Extension Inventory
Research Desk needs a genuine local Python workflow. Count how many .py files are present in the current directory.
๐ฏ Your Task
Count how many .py files are present in the current directory.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
Current project folder
Python files = 6
Show Program
from pathlib import Path
python_files = list(Path(".").glob("*.py"))
print("Python files =", len(python_files))CHALLENGE 17 HardChallenge Arena โ Two-File Merger
Core Skill: Combine Text Files
View Challenge โ
Challenge Arena โ Two-File Merger
Challenge Arena needs a genuine local Python workflow. Combine first.txt and second.txt into merged.txt with a newline between their contents.
๐ฏ Your Task
Combine first.txt and second.txt into merged.txt with a newline between their contents.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
first.txt and second.txt
Files merged
Show Program
with open("first.txt", "r", encoding="utf-8") as first:
first_text = first.read().rstrip("\n")
with open("second.txt", "r", encoding="utf-8") as second:
second_text = second.read().lstrip("\n")
with open("merged.txt", "w", encoding="utf-8") as merged:
merged.write(first_text + "\n" + second_text)
print("Files merged")CHALLENGE 18 HardRevision Room โ Error Log Scanner
Core Skill: Log File Analysis
View Challenge โ
Revision Room โ Error Log Scanner
Revision Room needs a genuine local Python workflow. Count lines containing ERROR in application.log.
๐ฏ Your Task
Count lines containing ERROR in application.log.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
application.log contains mixed INFO and ERROR lines
Errors = 4
Show Program
with open("application.log", "r", encoding="utf-8") as file:
error_count = sum(1 for line in file if "ERROR" in line)
print("Errors =", error_count)CHALLENGE 19 HardInterview Lab โ Blank-Line Cleaner
Core Skill: File Transformation
View Challenge โ
Interview Lab โ Blank-Line Cleaner
Interview Lab needs a genuine local Python workflow. Create clean.txt from raw.txt while removing blank lines.
๐ฏ Your Task
Create clean.txt from raw.txt while removing blank lines.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
raw.txt contains empty lines
Clean file created
Show Program
with open("raw.txt", "r", encoding="utf-8") as source:
lines = [line for line in source if line.strip()]
with open("clean.txt", "w", encoding="utf-8") as destination:
destination.writelines(lines)
print("Clean file created")CHALLENGE 20 HardCodeBhavya Hub โ Persistent Contact Book
Core Skill: CSV Records and Search
View Challenge โ
CodeBhavya Hub โ Persistent Contact Book
CodeBhavya Hub needs a genuine local Python workflow. Append a name and phone number to contacts.csv, then list all stored contacts.
๐ฏ Your Task
Append a name and phone number to contacts.csv, then list all stored contacts.
๐ฅ Input Format
Create the named local file or enter the requested data exactly as described.
๐ค Output Format
Produce the requested file or console result in the exact format shown.
๐ Constraints
Run this lab in a local Python 3 folder where file creation and persistent changes are allowed.
Asha,9876543210
Asha: 9876543210
Show Program
import csv
name = input("Name: ")
phone = input("Phone: ")
with open("contacts.csv", "a", newline="", encoding="utf-8") as file:
csv.writer(file).writerow([name, phone])
with open("contacts.csv", "r", newline="", encoding="utf-8") as file:
for saved_name, saved_phone in csv.reader(file):
print(f"{saved_name}: {saved_phone}")Level 11 โ Object-Oriented PythonClasses, inheritance, encapsulation and polymorphism. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 MediumOrientation Desk โ Student Object Card
Core Skill: Class, __init__ and Method
View Challenge โ
Orientation Desk โ Student Object Card
Orientation Desk needs a reliable Python utility. Create a Student class with name and score, then display '<name> scored <score>' through an instance method.
๐ฏ Your Task
Create a Student class with name and score, then display '<name> scored <score>' through an instance method.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Name is one word; 0 โค score โค 100.
Asha 91
Asha scored 91
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Student:
def __init__(self, name, score):
self.name = name
self.score = score
def display(self):
print(f"{self.name} scored {self.score}")
name = input()
score = int(input())
student = Student(name, score)
student.display()CHALLENGE 02 MediumCampus Portal โ Bank Account Guard
Core Skill: Encapsulation and Methods
View Challenge โ
Campus Portal โ Bank Account Guard
Campus Portal needs a reliable Python utility. Model an account, deposit an amount, then withdraw if sufficient funds remain. Print the final balance or Insufficient Funds.
๐ฏ Your Task
Model an account, deposit an amount, then withdraw if sufficient funds remain. Print the final balance or Insufficient Funds.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
All amounts are non-negative and at most 10^9.
1000 250 400
Balance = 850.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class BankAccount:
def __init__(self, balance):
self.balance = balance
def deposit(self, amount):
self.balance += amount
def withdraw(self, amount):
if amount > self.balance:
return False
self.balance -= amount
return True
opening = float(input())
deposit_amount = float(input())
withdrawal = float(input())
account = BankAccount(opening)
account.deposit(deposit_amount)
if account.withdraw(withdrawal):
print(f"Balance = {account.balance:.2f}")
else:
print("Insufficient Funds")CHALLENGE 03 MediumLearning Studio โ Shape Area Inheritance
Core Skill: Inheritance and Method Overriding
View Challenge โ
Learning Studio โ Shape Area Inheritance
Learning Studio needs a reliable Python utility. Create a base Shape and Rectangle/Square subclasses that return area. Read the shape data and print Area to two decimals.
๐ฏ Your Task
Create a base Shape and Rectangle/Square subclasses that return area. Read the shape data and print Area to two decimals.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Dimensions are positive and at most 100000.
Rectangle 4 3
Area = 12.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Shape:
def area(self):
raise NotImplementedError
class Rectangle(Shape):
def __init__(self, width, height):
self.width = width
self.height = height
def area(self):
return self.width * self.height
class Square(Shape):
def __init__(self, side):
self.side = side
def area(self):
return self.side ** 2
shape_type = input()
if shape_type == "Square":
shape = Square(float(input()))
else:
shape = Rectangle(float(input()), float(input()))
print(f"Area = {shape.area():.2f}")CHALLENGE 04 MediumSkill Tracker โ Polymorphic Sound Board
Core Skill: Polymorphism
View Challenge โ
Skill Tracker โ Polymorphic Sound Board
Skill Tracker needs a reliable Python utility. Read animal types and create matching objects whose speak() methods produce Dog: Woof, Cat: Meow or Cow: Moo.
๐ฏ Your Task
Read animal types and create matching objects whose speak() methods produce Dog: Woof, Cat: Meow or Cow: Moo.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The input contains only Dog, Cat and Cow separated by spaces.
Dog Cat Cow
Dog: Woof Cat: Meow Cow: Moo
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Dog:
def speak(self):
return "Woof"
class Cat:
def speak(self):
return "Meow"
class Cow:
def speak(self):
return "Moo"
classes = {"Dog": Dog, "Cat": Cat, "Cow": Cow}
for name in input().split():
animal = classes[name]()
print(f"{name}: {animal.speak()}")CHALLENGE 05 Medium+Mentor Console โ Product Object Counter
Core Skill: Class Attributes and Instances
View Challenge โ
Mentor Console โ Product Object Counter
Mentor Console needs a reliable Python utility. Read product prices, create one Product object for each price, then display object count and total price.
๐ฏ Your Task
Read product prices, create one Product object for each price, then display object count and total price.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 100 non-negative prices.
10 20 30
Objects = 3 Total = 60.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Product:
count = 0
def __init__(self, price):
self.price = price
Product.count += 1
prices = list(map(float, input().split()))
products = [Product(price) for price in prices]
print("Objects =", Product.count)
print(f"Total = {sum(product.price for product in products):.2f}")CHALLENGE 06 Medium+Library Counter โ Student Object Card
Core Skill: Class, __init__ and Method
View Challenge โ
Library Counter โ Student Object Card
Library Counter needs a reliable Python utility. Create a Student class with name and score, then display '<name> scored <score>' through an instance method.
๐ฏ Your Task
Create a Student class with name and score, then display '<name> scored <score>' through an instance method.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Name is one word; 0 โค score โค 100.
Ravi 84
Ravi scored 84
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Student:
def __init__(self, name, score):
self.name = name
self.score = score
def display(self):
print(f"{self.name} scored {self.score}")
name = input()
score = int(input())
student = Student(name, score)
student.display()CHALLENGE 07 Medium+Practice Lab โ Bank Account Guard
Core Skill: Encapsulation and Methods
View Challenge โ
Practice Lab โ Bank Account Guard
Practice Lab needs a reliable Python utility. Model an account, deposit an amount, then withdraw if sufficient funds remain. Print the final balance or Insufficient Funds.
๐ฏ Your Task
Model an account, deposit an amount, then withdraw if sufficient funds remain. Print the final balance or Insufficient Funds.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
All amounts are non-negative and at most 10^9.
500 100 700
Insufficient Funds
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class BankAccount:
def __init__(self, balance):
self.balance = balance
def deposit(self, amount):
self.balance += amount
def withdraw(self, amount):
if amount > self.balance:
return False
self.balance -= amount
return True
opening = float(input())
deposit_amount = float(input())
withdrawal = float(input())
account = BankAccount(opening)
account.deposit(deposit_amount)
if account.withdraw(withdrawal):
print(f"Balance = {account.balance:.2f}")
else:
print("Insufficient Funds")CHALLENGE 08 Medium+Quiz Engine โ Shape Area Inheritance
Core Skill: Inheritance and Method Overriding
View Challenge โ
Quiz Engine โ Shape Area Inheritance
Quiz Engine needs a reliable Python utility. Create a base Shape and Rectangle/Square subclasses that return area. Read the shape data and print Area to two decimals.
๐ฏ Your Task
Create a base Shape and Rectangle/Square subclasses that return area. Read the shape data and print Area to two decimals.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Dimensions are positive and at most 100000.
Square 5
Area = 25.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Shape:
def area(self):
raise NotImplementedError
class Rectangle(Shape):
def __init__(self, width, height):
self.width = width
self.height = height
def area(self):
return self.width * self.height
class Square(Shape):
def __init__(self, side):
self.side = side
def area(self):
return self.side ** 2
shape_type = input()
if shape_type == "Square":
shape = Square(float(input()))
else:
shape = Rectangle(float(input()), float(input()))
print(f"Area = {shape.area():.2f}")CHALLENGE 09 Medium+Project Hub โ Polymorphic Sound Board
Core Skill: Polymorphism
View Challenge โ
Project Hub โ Polymorphic Sound Board
Project Hub needs a reliable Python utility. Read animal types and create matching objects whose speak() methods produce Dog: Woof, Cat: Meow or Cow: Moo.
๐ฏ Your Task
Read animal types and create matching objects whose speak() methods produce Dog: Woof, Cat: Meow or Cow: Moo.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The input contains only Dog, Cat and Cow separated by spaces.
Cat Dog
Cat: Meow Dog: Woof
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Dog:
def speak(self):
return "Woof"
class Cat:
def speak(self):
return "Meow"
class Cow:
def speak(self):
return "Moo"
classes = {"Dog": Dog, "Cat": Cat, "Cow": Cow}
for name in input().split():
animal = classes[name]()
print(f"{name}: {animal.speak()}")CHALLENGE 10 Medium+Placement Desk โ Product Object Counter
Core Skill: Class Attributes and Instances
View Challenge โ
Placement Desk โ Product Object Counter
Placement Desk needs a reliable Python utility. Read product prices, create one Product object for each price, then display object count and total price.
๐ฏ Your Task
Read product prices, create one Product object for each price, then display object count and total price.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 100 non-negative prices.
99.5 50.5
Objects = 2 Total = 150.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Product:
count = 0
def __init__(self, price):
self.price = price
Product.count += 1
prices = list(map(float, input().split()))
products = [Product(price) for price in prices]
print("Objects =", Product.count)
print(f"Total = {sum(product.price for product in products):.2f}")CHALLENGE 11 Medium+Team Dashboard โ Student Object Card
Core Skill: Class, __init__ and Method
View Challenge โ
Team Dashboard โ Student Object Card
Team Dashboard needs a reliable Python utility. Create a Student class with name and score, then display '<name> scored <score>' through an instance method.
๐ฏ Your Task
Create a Student class with name and score, then display '<name> scored <score>' through an instance method.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Name is one word; 0 โค score โค 100.
Meera 95
Meera scored 95
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Student:
def __init__(self, name, score):
self.name = name
self.score = score
def display(self):
print(f"{self.name} scored {self.score}")
name = input()
score = int(input())
student = Student(name, score)
student.display()CHALLENGE 12 Medium+Data Centre โ Bank Account Guard
Core Skill: Encapsulation and Methods
View Challenge โ
Data Centre โ Bank Account Guard
Data Centre needs a reliable Python utility. Model an account, deposit an amount, then withdraw if sufficient funds remain. Print the final balance or Insufficient Funds.
๐ฏ Your Task
Model an account, deposit an amount, then withdraw if sufficient funds remain. Print the final balance or Insufficient Funds.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
All amounts are non-negative and at most 10^9.
2000 500 250
Balance = 2250.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class BankAccount:
def __init__(self, balance):
self.balance = balance
def deposit(self, amount):
self.balance += amount
def withdraw(self, amount):
if amount > self.balance:
return False
self.balance -= amount
return True
opening = float(input())
deposit_amount = float(input())
withdrawal = float(input())
account = BankAccount(opening)
account.deposit(deposit_amount)
if account.withdraw(withdrawal):
print(f"Balance = {account.balance:.2f}")
else:
print("Insufficient Funds")CHALLENGE 13 Medium+Student Vault โ Shape Area Inheritance
Core Skill: Inheritance and Method Overriding
View Challenge โ
Student Vault โ Shape Area Inheritance
Student Vault needs a reliable Python utility. Create a base Shape and Rectangle/Square subclasses that return area. Read the shape data and print Area to two decimals.
๐ฏ Your Task
Create a base Shape and Rectangle/Square subclasses that return area. Read the shape data and print Area to two decimals.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Dimensions are positive and at most 100000.
Rectangle 2.5 8
Area = 20.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Shape:
def area(self):
raise NotImplementedError
class Rectangle(Shape):
def __init__(self, width, height):
self.width = width
self.height = height
def area(self):
return self.width * self.height
class Square(Shape):
def __init__(self, side):
self.side = side
def area(self):
return self.side ** 2
shape_type = input()
if shape_type == "Square":
shape = Square(float(input()))
else:
shape = Rectangle(float(input()), float(input()))
print(f"Area = {shape.area():.2f}")CHALLENGE 14 Medium+Workshop Board โ Polymorphic Sound Board
Core Skill: Polymorphism
View Challenge โ
Workshop Board โ Polymorphic Sound Board
Workshop Board needs a reliable Python utility. Read animal types and create matching objects whose speak() methods produce Dog: Woof, Cat: Meow or Cow: Moo.
๐ฏ Your Task
Read animal types and create matching objects whose speak() methods produce Dog: Woof, Cat: Meow or Cow: Moo.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The input contains only Dog, Cat and Cow separated by spaces.
Cow Cow Dog
Cow: Moo Cow: Moo Dog: Woof
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Dog:
def speak(self):
return "Woof"
class Cat:
def speak(self):
return "Meow"
class Cow:
def speak(self):
return "Moo"
classes = {"Dog": Dog, "Cat": Cat, "Cow": Cow}
for name in input().split():
animal = classes[name]()
print(f"{name}: {animal.speak()}")CHALLENGE 15 HardCareer Console โ Product Object Counter
Core Skill: Class Attributes and Instances
View Challenge โ
Career Console โ Product Object Counter
Career Console needs a reliable Python utility. Read product prices, create one Product object for each price, then display object count and total price.
๐ฏ Your Task
Read product prices, create one Product object for each price, then display object count and total price.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 100 non-negative prices.
7 8 9 10
Objects = 4 Total = 34.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Product:
count = 0
def __init__(self, price):
self.price = price
Product.count += 1
prices = list(map(float, input().split()))
products = [Product(price) for price in prices]
print("Objects =", Product.count)
print(f"Total = {sum(product.price for product in products):.2f}")CHALLENGE 16 HardResearch Desk โ Student Object Card
Core Skill: Class, __init__ and Method
View Challenge โ
Research Desk โ Student Object Card
Research Desk needs a reliable Python utility. Create a Student class with name and score, then display '<name> scored <score>' through an instance method.
๐ฏ Your Task
Create a Student class with name and score, then display '<name> scored <score>' through an instance method.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Name is one word; 0 โค score โค 100.
Kiran 78
Kiran scored 78
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Student:
def __init__(self, name, score):
self.name = name
self.score = score
def display(self):
print(f"{self.name} scored {self.score}")
name = input()
score = int(input())
student = Student(name, score)
student.display()CHALLENGE 17 HardChallenge Arena โ Bank Account Guard
Core Skill: Encapsulation and Methods
View Challenge โ
Challenge Arena โ Bank Account Guard
Challenge Arena needs a reliable Python utility. Model an account, deposit an amount, then withdraw if sufficient funds remain. Print the final balance or Insufficient Funds.
๐ฏ Your Task
Model an account, deposit an amount, then withdraw if sufficient funds remain. Print the final balance or Insufficient Funds.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
All amounts are non-negative and at most 10^9.
750 50 300
Balance = 500.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class BankAccount:
def __init__(self, balance):
self.balance = balance
def deposit(self, amount):
self.balance += amount
def withdraw(self, amount):
if amount > self.balance:
return False
self.balance -= amount
return True
opening = float(input())
deposit_amount = float(input())
withdrawal = float(input())
account = BankAccount(opening)
account.deposit(deposit_amount)
if account.withdraw(withdrawal):
print(f"Balance = {account.balance:.2f}")
else:
print("Insufficient Funds")CHALLENGE 18 HardRevision Room โ Shape Area Inheritance
Core Skill: Inheritance and Method Overriding
View Challenge โ
Revision Room โ Shape Area Inheritance
Revision Room needs a reliable Python utility. Create a base Shape and Rectangle/Square subclasses that return area. Read the shape data and print Area to two decimals.
๐ฏ Your Task
Create a base Shape and Rectangle/Square subclasses that return area. Read the shape data and print Area to two decimals.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
Dimensions are positive and at most 100000.
Square 7
Area = 49.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Shape:
def area(self):
raise NotImplementedError
class Rectangle(Shape):
def __init__(self, width, height):
self.width = width
self.height = height
def area(self):
return self.width * self.height
class Square(Shape):
def __init__(self, side):
self.side = side
def area(self):
return self.side ** 2
shape_type = input()
if shape_type == "Square":
shape = Square(float(input()))
else:
shape = Rectangle(float(input()), float(input()))
print(f"Area = {shape.area():.2f}")CHALLENGE 19 HardInterview Lab โ Polymorphic Sound Board
Core Skill: Polymorphism
View Challenge โ
Interview Lab โ Polymorphic Sound Board
Interview Lab needs a reliable Python utility. Read animal types and create matching objects whose speak() methods produce Dog: Woof, Cat: Meow or Cow: Moo.
๐ฏ Your Task
Read animal types and create matching objects whose speak() methods produce Dog: Woof, Cat: Meow or Cow: Moo.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The input contains only Dog, Cat and Cow separated by spaces.
Dog
Dog: Woof
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Dog:
def speak(self):
return "Woof"
class Cat:
def speak(self):
return "Meow"
class Cow:
def speak(self):
return "Moo"
classes = {"Dog": Dog, "Cat": Cat, "Cow": Cow}
for name in input().split():
animal = classes[name]()
print(f"{name}: {animal.speak()}")CHALLENGE 20 HardCodeBhavya Hub โ Product Object Counter
Core Skill: Class Attributes and Instances
View Challenge โ
CodeBhavya Hub โ Product Object Counter
CodeBhavya Hub needs a reliable Python utility. Read product prices, create one Product object for each price, then display object count and total price.
๐ฏ Your Task
Read product prices, create one Product object for each price, then display object count and total price.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains 1 to 100 non-negative prices.
100
Objects = 1 Total = 100.00
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
class Product:
count = 0
def __init__(self, price):
self.price = price
Product.count += 1
prices = list(map(float, input().split()))
products = [Product(price) for price in prices]
print("Objects =", Product.count)
print(f"Total = {sum(product.price for product in products):.2f}")Level 12 โ Advanced Python & PlacementInterview algorithms, efficient structures and clean reasoning. โข 20 original CodeBhavya challengesOpen 20 Challenges
Every challenge preserves the learning objective of this level while using CodeBhavya story framing, explicit requirements and progressive difficulty.
CHALLENGE 01 MediumOrientation Desk โ Two-Sum Indices
Core Skill: Hash Map Lookup
View Challenge โ
Orientation Desk โ Two-Sum Indices
Orientation Desk needs a reliable Python utility. Read a target and a list of integers. Print the zero-based indices of the first pair whose sum is target, or Not Found.
๐ฏ Your Task
Read a target and a list of integers. Print the zero-based indices of the first pair whose sum is target, or Not Found.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
2 โค list length โค 100000; exactly one best first-found pair may exist.
9 2 7 11 15
0 1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
target = int(input())
numbers = list(map(int, input().split()))
seen = {}
for index, number in enumerate(numbers):
needed = target - number
if needed in seen:
print(seen[needed], index)
break
seen[number] = index
else:
print("Not Found")CHALLENGE 02 MediumCampus Portal โ Balanced Brackets
Core Skill: Stack
View Challenge โ
Campus Portal โ Balanced Brackets
Campus Portal needs a reliable Python utility. Read a bracket string and print Balanced only when every bracket closes in the correct order.
๐ฏ Your Task
Read a bracket string and print Balanced only when every bracket closes in the correct order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains only ()[]{} and has length at most 100000.
{[()]}Balanced
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
stack = []
pairs = {")": "(", "]": "[", "}": "{"}
for character in text:
if character in "([{":
stack.append(character)
elif not stack or stack.pop() != pairs[character]:
print("Not Balanced")
break
else:
print("Balanced" if not stack else "Not Balanced")CHALLENGE 03 MediumLearning Studio โ Maximum Subarray Sum
Core Skill: Kadane's Algorithm
View Challenge โ
Learning Studio โ Maximum Subarray Sum
Learning Studio needs a reliable Python utility. Read integers and print the largest sum of any non-empty contiguous subarray.
๐ฏ Your Task
Read integers and print the largest sum of any non-empty contiguous subarray.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000; each value lies between -10^9 and 10^9.
-2 1 -3 4 -1 2 1 -5 4
Maximum Sum = 6
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
current = best = numbers[0]
for number in numbers[1:]:
current = max(number, current + number)
best = max(best, current)
print("Maximum Sum =", best)CHALLENGE 04 MediumSkill Tracker โ Binary Search
Core Skill: O(log n) Search
View Challenge โ
Skill Tracker โ Binary Search
Skill Tracker needs a reliable Python utility. Read a sorted integer list and a target, then print its zero-based index or -1.
๐ฏ Your Task
Read a sorted integer list and a target, then print its zero-based index or -1.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000; input values are sorted in ascending order.
1 3 5 7 9 7
Index = 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
target = int(input())
left, right = 0, len(numbers) - 1
answer = -1
while left <= right:
middle = (left + right) // 2
if numbers[middle] == target:
answer = middle
break
if numbers[middle] < target:
left = middle + 1
else:
right = middle - 1
print("Index =", answer)CHALLENGE 05 Medium+Mentor Console โ Most Frequent Word
Core Skill: Hashing and Tie Breaking
View Challenge โ
Mentor Console โ Most Frequent Word
Mentor Console needs a reliable Python utility. Read lowercase words and print the most frequent word with its count. Break ties alphabetically.
๐ฏ Your Task
Read lowercase words and print the most frequent word with its count. Break ties alphabetically.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 to 100000 lowercase words.
code python code learn
code 2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
frequency = {}
for word in words:
frequency[word] = frequency.get(word, 0) + 1
best = min(frequency, key=lambda word: (-frequency[word], word))
print(best, frequency[best])CHALLENGE 06 Medium+Library Counter โ Two-Sum Indices
Core Skill: Hash Map Lookup
View Challenge โ
Library Counter โ Two-Sum Indices
Library Counter needs a reliable Python utility. Read a target and a list of integers. Print the zero-based indices of the first pair whose sum is target, or Not Found.
๐ฏ Your Task
Read a target and a list of integers. Print the zero-based indices of the first pair whose sum is target, or Not Found.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
2 โค list length โค 100000; exactly one best first-found pair may exist.
6 3 2 4
1 2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
target = int(input())
numbers = list(map(int, input().split()))
seen = {}
for index, number in enumerate(numbers):
needed = target - number
if needed in seen:
print(seen[needed], index)
break
seen[number] = index
else:
print("Not Found")CHALLENGE 07 Medium+Practice Lab โ Balanced Brackets
Core Skill: Stack
View Challenge โ
Practice Lab โ Balanced Brackets
Practice Lab needs a reliable Python utility. Read a bracket string and print Balanced only when every bracket closes in the correct order.
๐ฏ Your Task
Read a bracket string and print Balanced only when every bracket closes in the correct order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains only ()[]{} and has length at most 100000.
([)]
Not Balanced
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
stack = []
pairs = {")": "(", "]": "[", "}": "{"}
for character in text:
if character in "([{":
stack.append(character)
elif not stack or stack.pop() != pairs[character]:
print("Not Balanced")
break
else:
print("Balanced" if not stack else "Not Balanced")CHALLENGE 08 Medium+Quiz Engine โ Maximum Subarray Sum
Core Skill: Kadane's Algorithm
View Challenge โ
Quiz Engine โ Maximum Subarray Sum
Quiz Engine needs a reliable Python utility. Read integers and print the largest sum of any non-empty contiguous subarray.
๐ฏ Your Task
Read integers and print the largest sum of any non-empty contiguous subarray.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000; each value lies between -10^9 and 10^9.
5 -2 3 4
Maximum Sum = 10
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
current = best = numbers[0]
for number in numbers[1:]:
current = max(number, current + number)
best = max(best, current)
print("Maximum Sum =", best)CHALLENGE 09 Medium+Project Hub โ Binary Search
Core Skill: O(log n) Search
View Challenge โ
Project Hub โ Binary Search
Project Hub needs a reliable Python utility. Read a sorted integer list and a target, then print its zero-based index or -1.
๐ฏ Your Task
Read a sorted integer list and a target, then print its zero-based index or -1.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000; input values are sorted in ascending order.
2 4 6 8 10 5
Index = -1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
target = int(input())
left, right = 0, len(numbers) - 1
answer = -1
while left <= right:
middle = (left + right) // 2
if numbers[middle] == target:
answer = middle
break
if numbers[middle] < target:
left = middle + 1
else:
right = middle - 1
print("Index =", answer)CHALLENGE 10 Medium+Placement Desk โ Most Frequent Word
Core Skill: Hashing and Tie Breaking
View Challenge โ
Placement Desk โ Most Frequent Word
Placement Desk needs a reliable Python utility. Read lowercase words and print the most frequent word with its count. Break ties alphabetically.
๐ฏ Your Task
Read lowercase words and print the most frequent word with its count. Break ties alphabetically.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 to 100000 lowercase words.
red blue red green blue
blue 2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
frequency = {}
for word in words:
frequency[word] = frequency.get(word, 0) + 1
best = min(frequency, key=lambda word: (-frequency[word], word))
print(best, frequency[best])CHALLENGE 11 Medium+Team Dashboard โ Two-Sum Indices
Core Skill: Hash Map Lookup
View Challenge โ
Team Dashboard โ Two-Sum Indices
Team Dashboard needs a reliable Python utility. Read a target and a list of integers. Print the zero-based indices of the first pair whose sum is target, or Not Found.
๐ฏ Your Task
Read a target and a list of integers. Print the zero-based indices of the first pair whose sum is target, or Not Found.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
2 โค list length โค 100000; exactly one best first-found pair may exist.
10 1 3 5 7 9
1 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
target = int(input())
numbers = list(map(int, input().split()))
seen = {}
for index, number in enumerate(numbers):
needed = target - number
if needed in seen:
print(seen[needed], index)
break
seen[number] = index
else:
print("Not Found")CHALLENGE 12 Medium+Data Centre โ Balanced Brackets
Core Skill: Stack
View Challenge โ
Data Centre โ Balanced Brackets
Data Centre needs a reliable Python utility. Read a bracket string and print Balanced only when every bracket closes in the correct order.
๐ฏ Your Task
Read a bracket string and print Balanced only when every bracket closes in the correct order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains only ()[]{} and has length at most 100000.
(()[])
Balanced
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
stack = []
pairs = {")": "(", "]": "[", "}": "{"}
for character in text:
if character in "([{":
stack.append(character)
elif not stack or stack.pop() != pairs[character]:
print("Not Balanced")
break
else:
print("Balanced" if not stack else "Not Balanced")CHALLENGE 13 Medium+Student Vault โ Maximum Subarray Sum
Core Skill: Kadane's Algorithm
View Challenge โ
Student Vault โ Maximum Subarray Sum
Student Vault needs a reliable Python utility. Read integers and print the largest sum of any non-empty contiguous subarray.
๐ฏ Your Task
Read integers and print the largest sum of any non-empty contiguous subarray.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000; each value lies between -10^9 and 10^9.
-8 -3 -6 -2 -5 -4
Maximum Sum = -2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
current = best = numbers[0]
for number in numbers[1:]:
current = max(number, current + number)
best = max(best, current)
print("Maximum Sum =", best)CHALLENGE 14 Medium+Workshop Board โ Binary Search
Core Skill: O(log n) Search
View Challenge โ
Workshop Board โ Binary Search
Workshop Board needs a reliable Python utility. Read a sorted integer list and a target, then print its zero-based index or -1.
๐ฏ Your Task
Read a sorted integer list and a target, then print its zero-based index or -1.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000; input values are sorted in ascending order.
-5 0 4 11 -5
Index = 0
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
target = int(input())
left, right = 0, len(numbers) - 1
answer = -1
while left <= right:
middle = (left + right) // 2
if numbers[middle] == target:
answer = middle
break
if numbers[middle] < target:
left = middle + 1
else:
right = middle - 1
print("Index =", answer)CHALLENGE 15 HardCareer Console โ Most Frequent Word
Core Skill: Hashing and Tie Breaking
View Challenge โ
Career Console โ Most Frequent Word
Career Console needs a reliable Python utility. Read lowercase words and print the most frequent word with its count. Break ties alphabetically.
๐ฏ Your Task
Read lowercase words and print the most frequent word with its count. Break ties alphabetically.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 to 100000 lowercase words.
one two three
one 1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
frequency = {}
for word in words:
frequency[word] = frequency.get(word, 0) + 1
best = min(frequency, key=lambda word: (-frequency[word], word))
print(best, frequency[best])CHALLENGE 16 HardResearch Desk โ Two-Sum Indices
Core Skill: Hash Map Lookup
View Challenge โ
Research Desk โ Two-Sum Indices
Research Desk needs a reliable Python utility. Read a target and a list of integers. Print the zero-based indices of the first pair whose sum is target, or Not Found.
๐ฏ Your Task
Read a target and a list of integers. Print the zero-based indices of the first pair whose sum is target, or Not Found.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
2 โค list length โค 100000; exactly one best first-found pair may exist.
14 8 6 2 12
0 1
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
target = int(input())
numbers = list(map(int, input().split()))
seen = {}
for index, number in enumerate(numbers):
needed = target - number
if needed in seen:
print(seen[needed], index)
break
seen[number] = index
else:
print("Not Found")CHALLENGE 17 HardChallenge Arena โ Balanced Brackets
Core Skill: Stack
View Challenge โ
Challenge Arena โ Balanced Brackets
Challenge Arena needs a reliable Python utility. Read a bracket string and print Balanced only when every bracket closes in the correct order.
๐ฏ Your Task
Read a bracket string and print Balanced only when every bracket closes in the correct order.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
The line contains only ()[]{} and has length at most 100000.
{}[]Balanced
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
text = input()
stack = []
pairs = {")": "(", "]": "[", "}": "{"}
for character in text:
if character in "([{":
stack.append(character)
elif not stack or stack.pop() != pairs[character]:
print("Not Balanced")
break
else:
print("Balanced" if not stack else "Not Balanced")CHALLENGE 18 HardRevision Room โ Maximum Subarray Sum
Core Skill: Kadane's Algorithm
View Challenge โ
Revision Room โ Maximum Subarray Sum
Revision Room needs a reliable Python utility. Read integers and print the largest sum of any non-empty contiguous subarray.
๐ฏ Your Task
Read integers and print the largest sum of any non-empty contiguous subarray.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000; each value lies between -10^9 and 10^9.
1 2 3 4
Maximum Sum = 10
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
current = best = numbers[0]
for number in numbers[1:]:
current = max(number, current + number)
best = max(best, current)
print("Maximum Sum =", best)CHALLENGE 19 HardInterview Lab โ Binary Search
Core Skill: O(log n) Search
View Challenge โ
Interview Lab โ Binary Search
Interview Lab needs a reliable Python utility. Read a sorted integer list and a target, then print its zero-based index or -1.
๐ฏ Your Task
Read a sorted integer list and a target, then print its zero-based index or -1.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 โค n โค 100000; input values are sorted in ascending order.
10 20 30 40 40
Index = 3
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
numbers = list(map(int, input().split()))
target = int(input())
left, right = 0, len(numbers) - 1
answer = -1
while left <= right:
middle = (left + right) // 2
if numbers[middle] == target:
answer = middle
break
if numbers[middle] < target:
left = middle + 1
else:
right = middle - 1
print("Index =", answer)CHALLENGE 20 HardCodeBhavya Hub โ Most Frequent Word
Core Skill: Hashing and Tie Breaking
View Challenge โ
CodeBhavya Hub โ Most Frequent Word
CodeBhavya Hub needs a reliable Python utility. Read lowercase words and print the most frequent word with its count. Break ties alphabetically.
๐ฏ Your Task
Read lowercase words and print the most frequent word with its count. Break ties alphabetically.
๐ฅ Input Format
Read the required value or values from standard input in the order shown.
๐ค Output Format
Print only the requested result in the exact format shown.
๐ Constraints
1 to 100000 lowercase words.
practice makes progress practice
practice 2
Python Code Editor
Run uses the sample input. Check Answer runs the sample plus hidden test cases.
Sample Input
Output
Run your program to see the output.
Test Cases
words = input().split()
frequency = {}
for word in words:
frequency[word] = frequency.get(word, 0) + 1
best = min(frequency, key=lambda word: (-frequency[word], word))
print(best, frequency[best])Practice rule: Try the problem before opening the hint. Viewing a hint limits the competitive score to 90; viewing the official program changes the result to โcompleted with solutionโ. Progress is stored in this browser.
