Python Practice Questions
Write the code, run it in your browser, and submit it to check it against the tests. No install and no sign-up needed.
- 1.Python Program to Print Hello WorldPracticeEasy
- 27.Python Program to Print a Welcome MessagePracticeEasy
- 2.Python Program to Print a Phone Number Without Quotesprint() basicsEasy
- 3.Python Program to Print a String and a Number Togetherprint() basicsEasy
- 4.Python Program to Print a Message and a Calculation in One Lineprint() basicsEasy
- 5.Python Program to Print Multiple Lines with One print()Escape sequencesEasy
- 6.Python Program to Create a Name Card Using TabsEscape sequencesEasy
- 7.Python Program to Print Nested Quotes with Escape CharactersEscape sequencesEasy
- 8.Python Program to Print Details Separated by Commassep and endEasy
- 9.Python Program to Print One Line with Several print() Callssep and endEasy
- 10.Python Program to Print Multiple Lines Without Escape SequencesTriple quotesEasy
- 11.Python Program to Print a Digital ReceiptEscape sequencesMedium
- 12.Python Program to Print a Console DashboardTriple quotesHard
- 13.Python Program to Print Multiple Linesprint() basicsEasy
- 14.Python Program to Print Escape Sequences as TextEscape sequencesEasy
- 15.Python Program to Print a List with sep and endsep and endMedium
- 28.Fix the print() Errors in a Greeting ProgramCommon errorsEasy
- 29.Fix the print() Errors in a Receipt HeaderCommon errorsMedium
- 30.Python Program to Print the Steps of an ATM WithdrawalAlgorithmsEasy
- 31.Python Program to Print a Recipe From a FlowchartFlowchartsEasy
- 32.Fix a Python Program With Steps in the Wrong OrderDebuggingEasy
- 16.Python Program to Create and Print a VariableVariablesEasy
- 17.Python Program to Create and Print a Boolean VariableTypesEasy
- 18.Python Program to Show That Variable Names Are Case-SensitiveNaming rulesEasy
- 19.Python Program to Assign One Value to Several VariablesHow they workEasy
- 20.Python Program to Reassign a VariableHow they workMedium
- 21.Python Program to Add Two VariablesVariablesEasy
- 22.Python Program to Find the Area of a Rectangle Using VariablesVariablesMedium
- 24.Python Program to Swap Two Variables Without a Temporary VariableHow they workMedium
- 25.Python Program to Rotate the Values of Three VariablesHow they workMedium
- 26.Python Program to Check the Type of a VariableTypesEasy
- 33.Fix the Invalid Variable Names in a Python ProgramNaming rulesEasy
- 34.Python Program to Print a Shopping Bill with VariablesTypesHard
- 23.Python Program to Calculate and Format a Total CostStringsMedium
- 35.Python Program to Join a First and Last NameStringsEasy
- 36.Python Program to Count the Characters in a WordStringsEasy
- 37.Python Program to Find the Quotient and RemainderNumbersEasy
- 38.Python Program to Calculate Simple InterestNumbersMedium
- 39.Python Program to Convert Minutes to Hours and MinutesNumbersMedium
- 40.Python Program to Compare Two NumbersBooleansEasy
- 41.Python Program to Check If Two Passwords MatchBooleansEasy
- 42.Python Program to Add Two Numbers Stored as TextNone & conversionEasy
- 43.Python Program to Print a Temperature ReportNone & conversionHard
- 44.Python Program to Print a Hashtag Inside a StringCommentsEasy
- 45.Fix a Python Program with a Comment Missing Its #CommentsEasy
- 46.Python Program to Calculate a Bill with Clear CommentsGood commentsEasy
- 47.Python Program to Explain a Calculation with CommentsGood commentsMedium
- 48.Fix a Python Program by Commenting Out Debug PrintsComment outEasy
- 49.Fix a Python Program by Commenting Out an Unfinished LineComment outMedium
- 50.Fix and Tidy a Messy Python ProgramComment outHard
- 51.Python Program to Greet the User by Nameinput()Easy
- 52.Python Program to Read Two Words and Make a Sentenceinput()Easy
- 53.Python Program to Add Two Numbers from InputConvert inputEasy
- 54.Python Program to Find a Rectangle's Area from InputConvert inputEasy
- 55.Python Program to Convert Celsius to Fahrenheit from InputConvert inputMedium
- 56.Python Program to Calculate Age in MonthsInteractiveEasy
- 57.Python Program to Split a Bill Between FriendsInteractiveMedium
- 58.Python Program to Make a Shopping Receipt from InputInteractiveHard
- 59.Python Program to Check If a Number Is PositiveifEasy
- 60.Python Program to Apply a Discount on Orders Over 1000ifEasy
- 61.Python Program to Check If a Number Is Even or Oddelse and elifEasy
- 62.Python Program to Find the Larger of Two Numberselse and elifEasy
- 63.Python Program to Calculate a Grade from Markselse and elifMedium
- 64.Python Program to Check If a Number Is Between 1 and 100and, or, notEasy
- 65.Python Program to Check If a Day Is a Weekendand, or, notEasy
- 66.Python Program to Check If a Year Is a Leap Yearand, or, notMedium
- 67.Python Program to Check a Username and PasswordNested ifMedium
- 68.Python Program to Divide Two Numbers SafelyNested ifEasy
- 69.Python Program to Make a Simple ATMNested ifHard
- 70.Python Program to Create and Print a ListListsEasy
- 71.Python Program to Build a Seat List with + and *ListsMedium
- 72.Python Program to Print the First and Last Item of a ListIndexingEasy
- 73.Python Program to Find the Day Name from Its NumberIndexingMedium
- 74.Python Program to Print the Top Three ScoresSlicingEasy
- 75.Python Program to Get the Last Few Temperatures from a ListSlicingMedium
- 76.Python Program to Add Items to a Shopping ListAdd, removeEasy
- 77.Python Program to Remove a Task by Its NumberAdd, removeMedium
- 78.Python Program to Check If an Item Is on the MenuList toolsEasy
- 79.Python Program to Make a Class Marks ReportList toolsHard
- 80.Python Program to Print Each Letter of a Wordfor loopEasy
- 81.Python Program to Remove Spaces from a Sentencefor loopMedium
- 82.Python Program to Print Numbers from 1 to Nrange()Easy
- 83.Python Program to Print a Multiplication Tablerange()Easy
- 84.Python Program to Print a Countdownrange()Medium
- 85.Python Program to Find the Sum of N NumbersSum and countEasy
- 86.Python Program to Count the Vowels in a WordSum and countMedium
- 87.Python Program to Find the Largest of N NumbersSum and countMedium
- 88.Python Program to Print a Star TriangleNested loopsMedium
- 89.Python Program to Print Prime Numbers up to NNested loopsHard
- 90.Python Program to Print Numbers from 1 to N Using a While LoopwhileEasy
- 91.Python Program to Print a Countdown with a While LoopwhileEasy
- 92.Python Program to Find the Sum of Digits of a NumberwhileMedium
- 93.Fix the Endless Countdown LoopEndless loopsEasy
- 94.Python Program to Count the Weeks to Reach a Savings GoalEndless loopsMedium
- 95.Python Program to Add Numbers Until the User Types 0Input loopsEasy
- 96.Python Program to Ask Again Until the Age Is ValidInput loopsEasy
- 97.Python Program to Find the Largest Number Until done Is TypedInput loopsMedium
- 98.Python Program to Count the Steps of the Collatz Sequencewhile or forMedium
- 99.Python Program to Make a Number Guessing Gamewhile or forHard
- 100.Python Program to Print the First and Last Character of a StringIndex and sliceEasy
- 101.Python Program to Check if a String Is a PalindromeIndex and sliceMedium
- 102.Python Program to Clean Up a Name with strip() and title()MethodsEasy
- 103.Python Program to Count the Vowels in a SentenceMethodsMedium
- 104.Python Program to Check a Simple Email AddressMethodsMedium
- 105.Python Program to Count the Words in a SentenceSplit and joinEasy
- 106.Python Program to Reverse the Words in a SentenceSplit and joinMedium
- 107.Python Program to Format a Number with CommasFormattingEasy
- 108.Python Program to Print a Multiplication Table in ColumnsFormattingMedium
- 109.Python Program to Print a Neat Bill from Input LinesFormattingHard
- 110.Python Program to Create a Dictionary from InputDictionaryEasy
- 111.Fix the Broken Phone Book DictionaryDictionaryMedium
- 112.Python Program to Look Up a Phone NumberRead valuesEasy
- 113.Python Program to Calculate a Fruit BillRead valuesMedium
- 114.Python Program to Add or Update a Mark in a DictionaryChange itemsEasy
- 115.Python Program to Remove an Item from a Shopping CartChange itemsMedium
- 116.Python Program to Build a Price List from InputChange itemsMedium
- 117.Python Program to Print a Menu from a DictionaryLoopingEasy
- 118.Python Program to Count Each Letter in a WordLoopingMedium
- 119.Python Program to Manage a Shop InventoryLoopingHard
- 120.Python Program to Find the Day Name from a Number Using a TupleTuplesEasy
- 121.Python Program to Find the Day of the Year Using a TupleTuplesMedium
- 122.Python Program to Swap Two Numbers Using Tuple UnpackingUnpackingEasy
- 123.Python Program to Print a Marks Report from a List of TuplesUnpackingMedium
- 124.Python Program to Count Unique Words in a SentenceSetsEasy
- 125.Python Program to Find the First Repeated WordSetsMedium
- 126.Python Program to Find Common Friends Using SetsSetsMedium
- 127.Python Program to Convert a List into a Set and a TupleWhich one?Easy
- 128.Python Program to Count Different Points Using a Set of TuplesWhich one?Medium
- 129.Python Program to Make a Class Attendance ReportWhich one?Hard
- 130.Python Program to Print a Welcome Banner Using a FunctionFunctionsEasy
- 131.Python Program to Draw a Box Using FunctionsFunctionsMedium
- 132.Python Program to Find the Area and Perimeter Using a FunctionArgumentsEasy
- 133.Python Program to Calculate a Bill with a Default TipArgumentsMedium
- 134.Python Program to Print a Triangle Using a Function with ParametersArgumentsMedium
- 135.Python Program to Convert Celsius to Fahrenheit Using a FunctionreturnEasy
- 136.Python Program to Find the Largest of Three Numbers Using a FunctionreturnMedium
- 137.Python Program to Check a Prime Number Using a FunctionreturnMedium
- 138.Fix the NameError in a Python FunctionScopeEasy
- 139.Python Program to Make a Marks Report Using FunctionsScopeHard
- 140.Python Program to Rewrite Squashed Code in PEP 8 StylePEP 8Easy
- 141.Fix a Messy Python Program That Won't RunPEP 8Medium
- 142.Python Program to Rename Unclear VariablesNamingEasy
- 143.Fix a Variable That Hides a Python Built-in FunctionNamingEasy
- 144.Python Program to Rename Functions and Constants in PEP 8 StyleNamingMedium
- 145.Fix the Indentation in a Python FunctionSpacingEasy
- 146.Python Program to Break a Long Line of Code (PEP 8)SpacingMedium
- 147.Python Program to Replace Magic Numbers with Named ConstantsClean codeEasy
- 148.Python Program to Replace Repeated Code with a FunctionClean codeMedium
- 149.Python Program to Clean Up a Messy Report CardClean codeHard
- 150.Fix a TypeError in a Birthday MessageExceptionsEasy
- 151.Fix a KeyError in a Price LookupExceptionsMedium
- 152.Python Program to Double a Number with try and excepttry and exceptEasy
- 153.Python Program to Split a Bill Safelytry and exceptMedium
- 154.Python Program to Check Even or Odd with try, except and elseelse and finallyEasy
- 155.Python Program to Make a Ticket Machine with finallyelse and finallyMedium
- 156.Python Program to Check an Age with raiseraiseEasy
- 157.Python Program to Withdraw Money with raiseraiseMedium
- 158.Python Program to Keep Asking for a Valid AgeSafe inputMedium
- 159.Python Program to Make a Safe CalculatorSafe inputHard
- 160.Python Program to Find the Square Root Using the math ModuleImportEasy
- 161.Python Program to Find the GCD and LCM of Two NumbersImportMedium
- 162.Python Program to Find the Area and Circumference of a CirclemathEasy
- 163.Python Program to Find How Many Boxes You Need Using math.ceilmathEasy
- 164.Python Program to Find the Distance Between Two PointsmathMedium
- 165.Python Program to Roll Two Dice Using random.seedrandomEasy
- 166.Python Program to Make a Random Number Guessing GamerandomMedium
- 167.Python Program to Find the Number of Days Between Two DatesdatetimeEasy
- 168.Python Program to Calculate Age from a Date of BirthdatetimeMedium
- 169.Python Program to Make a Library Due Date and Fine CalculatordatetimeHard
- 170.Python Program to Save a Name in a File and Read It Backopen()Easy
- 171.Python Program to Copy a Text Fileopen()Medium
- 172.Python Program to Write a Shopping List to a FileWriteEasy
- 173.Python Program to Append Entries to a Diary FileWriteMedium
- 174.Python Program to Read a File Line by LineReadEasy
- 175.Python Program to Count Lines and Words in a FileReadMedium
- 176.Python Program to Find a Word in a FileReadMedium
- 177.Fix the Python Program That Never Closes Its FilewithEasy
- 178.Python Program to Read a File Safely with try and exceptwithMedium
- 179.Python Program to Save and Load a Score ListwithHard
- 180.Python Program to Create a Class and an ObjectClassesEasy
- 181.Python Program to Find the Older Pet Using ObjectsClassesMedium
- 182.Python Program to Make a Student Class with __init____init__Easy
- 183.Python Program to Track a Game Character's Health__init__Medium
- 184.Python Program to Find Area and Perimeter Using a ClassMethodsEasy
- 185.Python Program to Make a Bank Account ClassMethodsMedium
- 186.Python Program to Print a Book Object Using __str____str__Easy
- 187.Python Program to Print a Shopping Cart of Objects__str__Medium
- 188.Python Program to Make Animal Classes Using InheritanceInheritanceMedium
- 189.Python Program to Build a Bank with Savings AccountsInheritanceHard
- 190.Python Program to Play FizzBuzz from 1 to NInterview PackEasy
- 191.Python Program to Reverse a StringInterview PackEasy
- 192.Python Program to Reverse the Digits of a NumberInterview PackEasy
- 193.Python Program to Find the Factorial of a NumberInterview PackEasy
- 194.Python Program to Print the Fibonacci Series up to N TermsInterview PackEasy
- 195.Python Program to Check If a Number Is an Armstrong NumberInterview PackEasy
- 196.Python Program to Check If a Number Is a Perfect NumberInterview PackEasy
- 197.Python Program to Count Uppercase, Lowercase, Digits and SpacesInterview PackEasy
- 198.Python Program to Check If Two Words Are AnagramsInterview PackEasy
- 199.Python Program to Check If a Sentence Is a PangramInterview PackEasy
- 200.Python Program to Remove Duplicates from a List and Keep the OrderInterview PackEasy
- 201.Python Program to Count How Many Times a Number Appears in a ListInterview PackEasy
- 202.Python Program to Count Positive, Negative and Zero Numbers in a ListInterview PackEasy
- 203.Python Program to Check If a List Is SortedInterview PackEasy
- 204.Python Program to Find the Second Largest Number in a ListInterview PackMedium
- 205.Python Program to Find the Missing Number from 1 to NInterview PackMedium
- 206.Python Program to Find the Numbers That Appear More Than OnceInterview PackMedium
- 207.Python Program to Find the Most Common Character in a StringInterview PackMedium
- 208.Python Program to Remove Repeated Characters from a StringInterview PackMedium
- 209.Python Program to Check If a Sentence Is a Palindrome Ignoring SpacesInterview PackMedium
- 210.Python Program to Find the Longest Word in a SentenceInterview PackMedium
- 211.Python Program to Count How Often Each Word AppearsInterview PackMedium
- 212.Python Program to Merge Two Sorted Lists Without sort()Interview PackMedium
- 213.Python Program to Rotate a List by K PlacesInterview PackMedium
- 214.Python Program to Find the Items Two Lists Have in CommonInterview PackMedium
- 215.Python Program to Find Two Numbers That Add Up to a TargetInterview PackMedium
- 216.Python Program to Compress a String with Letter CountsInterview PackMedium
- 217.Python Program to Move All Zeros to the End of a ListInterview PackMedium
- 218.Python Program to Check If Brackets Are BalancedInterview PackHard
- 219.Python Program to Find the First Character That Does Not RepeatInterview PackHard
- 220.Python Program to Group Words That Are AnagramsInterview PackHard
- 221.Python Program to Find the Longest Part Without Repeated LettersInterview PackHard
- 222.Python Program to Find the Largest Sum of a Run of NumbersInterview PackHard
- 223.Python Program to Convert a Number to Roman NumeralsInterview PackHard
- 224.Python Program to Convert Roman Numerals to a NumberInterview PackHard
- 225.Python Program to Find a Number with Binary SearchInterview PackHard
- 226.Python Program to Sort a List with Bubble SortInterview PackHard
- 227.Python Program to Transpose a MatrixInterview PackHard
- 228.Python Program to Find the Longest Common Start of WordsInterview PackHard
- 229.Python Program to Hide a Message with a Caesar CipherInterview PackHard
- 230.Python Program to Calculate an Electricity Bill with Price SlabsMini ProjectsEasy
- 231.Python Program to Calculate BMI and Show Its CategoryMini ProjectsEasy
- 232.Python Program to Calculate a Parking Fee by HoursMini ProjectsEasy
- 233.Python Program to Find a Movie Ticket Price by Age and DayMini ProjectsEasy
- 234.Python Program to Calculate the Fuel Cost of a TripMini ProjectsEasy
- 235.Python Program to Convert Money with Fixed Exchange RatesMini ProjectsEasy
- 236.Python Program to Calculate a Monthly Loan PaymentMini ProjectsEasy
- 237.Python Program to Make a Salary Slip with Net PayMini ProjectsEasy
- 238.Python Program to Scale a Recipe for More PeopleMini ProjectsEasy
- 239.Python Program to Check How Strong a Password IsMini ProjectsEasy
- 240.Python Program to Make a Unit Converter MenuMini ProjectsEasy
- 241.Python Program to Make a Weekly Step CounterMini ProjectsEasy
- 242.Python Program to Check If a Shop Is OpenMini ProjectsEasy
- 243.Python Program to Find a Gym Membership Price with OffersMini ProjectsEasy
- 244.Python Program to Make a To-Do List with CommandsMini ProjectsMedium
- 245.Python Program to Make a Contact Book with CommandsMini ProjectsMedium
- 246.Python Program to Make a Quiz Game That Gives a ScoreMini ProjectsMedium
- 247.Python Program to Count Votes and Find the WinnerMini ProjectsMedium
- 248.Python Program to Track Expenses by CategoryMini ProjectsMedium
- 249.Python Program to Book Cinema Seats with a Seat MapMini ProjectsMedium
- 250.Python Program to Book Train Tickets with a Waiting ListMini ProjectsMedium
- 251.Python Program to Make a Game LeaderboardMini ProjectsMedium
- 252.Python Program to Rank Students by PercentageMini ProjectsMedium
- 253.Python Program to Apply Coupon Codes to a Shopping CartMini ProjectsMedium
- 254.Python Program to Lend and Return Library BooksMini ProjectsMedium
- 255.Python Program to Make a Weekly Weather SummaryMini ProjectsMedium
- 256.Python Program to Count the Floors a Lift TravelsMini ProjectsMedium
- 257.Python Program to Book Hotel Rooms with Check-In and Check-OutMini ProjectsMedium
- 258.Python Program to Make a Wallet App with TransfersMini ProjectsHard
- 259.Python Program to Find the Winner of Tic-Tac-ToeMini ProjectsHard
- 260.Python Program to Play Snakes and Ladders with Given Dice RollsMini ProjectsHard
- 261.Python Program to Make a Vending Machine That Gives ChangeMini ProjectsHard
- 262.Python Program to Make a Parking Lot with ClassesMini ProjectsHard
- 263.Python Program to Make a Hospital Queue with Emergencies FirstMini ProjectsHard
- 264.Python Program to Calculate Payroll with Overtime and TaxMini ProjectsHard
- 265.Python Program to Total Each Column of a Mini SpreadsheetMini ProjectsHard
- 266.Python Program to Run a Rock-Paper-Scissors TournamentMini ProjectsHard
- 267.Python Program to Give Each Food Order to the Nearest RiderMini ProjectsHard
- 268.Python Program to Print a Calendar MonthMini ProjectsHard
- 269.Python Program to Check a Sign-Up Form and Show Every ErrorMini ProjectsHard
- 270.Python Program to Print a Square of StarsLogic & PatternsEasy
- 271.Python Program to Print a Number TriangleLogic & PatternsEasy
- 272.Python Program to Print a Row-Number TriangleLogic & PatternsEasy
- 273.Python Program to Print an Upside-Down Star TriangleLogic & PatternsEasy
- 274.Python Program to Print a Right-Aligned Star TriangleLogic & PatternsEasy
- 275.Python Program to Print a Hollow SquareLogic & PatternsEasy
- 276.Python Program to Print a Letter TriangleLogic & PatternsEasy
- 277.Python Program to Print Letter RowsLogic & PatternsEasy
- 278.Python Program to Print a Chessboard PatternLogic & PatternsEasy
- 279.Python Program to Print Floyd's TriangleLogic & PatternsEasy
- 280.Python Program to Print a 0 and 1 TriangleLogic & PatternsEasy
- 281.Python Program to Print a Countdown Number TriangleLogic & PatternsEasy
- 282.Python Program to Print a Plus Sign of StarsLogic & PatternsEasy
- 283.Python Program to Print a Name Banner in a BoxLogic & PatternsEasy
- 284.Python Program to Print a Star PyramidLogic & PatternsMedium
- 285.Python Program to Print an Upside-Down Star PyramidLogic & PatternsMedium
- 286.Python Program to Print a Diamond of StarsLogic & PatternsMedium
- 287.Python Program to Print a Hollow TriangleLogic & PatternsMedium
- 288.Python Program to Print a Palindrome Number PyramidLogic & PatternsMedium
- 289.Python Program to Print Pascal's TriangleLogic & PatternsMedium
- 290.Python Program to Print an Hourglass of StarsLogic & PatternsMedium
- 291.Python Program to Print a Butterfly PatternLogic & PatternsMedium
- 292.Python Program to Print an X PatternLogic & PatternsMedium
- 293.Python Program to Find the Digital Root of a NumberLogic & PatternsMedium
- 294.Python Program to Check If a Number Is a Strong NumberLogic & PatternsMedium
- 295.Python Program to Check If a Number Is a Happy NumberLogic & PatternsMedium
- 296.Python Program to Turn a Number into Binary by HandLogic & PatternsMedium
- 297.Python Program to Find the Next Palindrome NumberLogic & PatternsMedium
- 298.Python Program to Print a Hollow DiamondLogic & PatternsHard
- 299.Python Program to Print a Zigzag PatternLogic & PatternsHard
- 300.Python Program to Print a Number SpiralLogic & PatternsHard
- 301.Python Program to Find Twin Primes in a RangeLogic & PatternsHard
- 302.Python Program to Count the Steps of Kaprekar's RoutineLogic & PatternsHard
- 303.Python Program to Check a Magic SquareLogic & PatternsHard
- 304.Python Program to Print the Moves of the Tower of HanoiLogic & PatternsHard
- 305.Python Program to Write a Number in WordsLogic & PatternsHard
- 306.Python Program to Check a Sudoku GridLogic & PatternsHard
- 307.Python Program to Print the Look-and-Say SequenceLogic & PatternsHard
- 308.Python Program to Play One Step of the Game of LifeLogic & PatternsHard
- 309.Python Program to Find the Angle Between Clock HandsLogic & PatternsHard
Showing 309 of 309 questions