livepython.net

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.

Python Interview Pack40 questions · 0 solvedNeeds chapters 8 to 15Open the pack →Real-World Python: Mini Projects40 questions · 0 solvedNeeds chapters 7 to 20Open the pack →Python Logic & Patterns40 questions · 0 solvedNeeds chapters 8 to 15Open the pack →
  1. 1.Python Program to Print Hello WorldEasy
  2. 27.Python Program to Print a Welcome MessageEasy
  3. 2.Python Program to Print a Phone Number Without QuotesEasy
  4. 3.Python Program to Print a String and a Number TogetherEasy
  5. 4.Python Program to Print a Message and a Calculation in One LineEasy
  6. 5.Python Program to Print Multiple Lines with One print()Easy
  7. 6.Python Program to Create a Name Card Using TabsEasy
  8. 7.Python Program to Print Nested Quotes with Escape CharactersEasy
  9. 8.Python Program to Print Details Separated by CommasEasy
  10. 9.Python Program to Print One Line with Several print() CallsEasy
  11. 10.Python Program to Print Multiple Lines Without Escape SequencesEasy
  12. 11.Python Program to Print a Digital ReceiptMedium
  13. 12.Python Program to Print a Console DashboardHard
  14. 13.Python Program to Print Multiple LinesEasy
  15. 14.Python Program to Print Escape Sequences as TextEasy
  16. 15.Python Program to Print a List with sep and endMedium
  17. 28.Fix the print() Errors in a Greeting ProgramEasy
  18. 29.Fix the print() Errors in a Receipt HeaderMedium
  19. 30.Python Program to Print the Steps of an ATM WithdrawalEasy
  20. 31.Python Program to Print a Recipe From a FlowchartEasy
  21. 32.Fix a Python Program With Steps in the Wrong OrderEasy
  22. 16.Python Program to Create and Print a VariableEasy
  23. 17.Python Program to Create and Print a Boolean VariableEasy
  24. 18.Python Program to Show That Variable Names Are Case-SensitiveEasy
  25. 19.Python Program to Assign One Value to Several VariablesEasy
  26. 20.Python Program to Reassign a VariableMedium
  27. 21.Python Program to Add Two VariablesEasy
  28. 22.Python Program to Find the Area of a Rectangle Using VariablesMedium
  29. 24.Python Program to Swap Two Variables Without a Temporary VariableMedium
  30. 25.Python Program to Rotate the Values of Three VariablesMedium
  31. 26.Python Program to Check the Type of a VariableEasy
  32. 33.Fix the Invalid Variable Names in a Python ProgramEasy
  33. 34.Python Program to Print a Shopping Bill with VariablesHard
  34. 23.Python Program to Calculate and Format a Total CostMedium
  35. 35.Python Program to Join a First and Last NameEasy
  36. 36.Python Program to Count the Characters in a WordEasy
  37. 37.Python Program to Find the Quotient and RemainderEasy
  38. 38.Python Program to Calculate Simple InterestMedium
  39. 39.Python Program to Convert Minutes to Hours and MinutesMedium
  40. 40.Python Program to Compare Two NumbersEasy
  41. 41.Python Program to Check If Two Passwords MatchEasy
  42. 42.Python Program to Add Two Numbers Stored as TextEasy
  43. 43.Python Program to Print a Temperature ReportHard
  44. 44.Python Program to Print a Hashtag Inside a StringEasy
  45. 45.Fix a Python Program with a Comment Missing Its #Easy
  46. 46.Python Program to Calculate a Bill with Clear CommentsEasy
  47. 47.Python Program to Explain a Calculation with CommentsMedium
  48. 48.Fix a Python Program by Commenting Out Debug PrintsEasy
  49. 49.Fix a Python Program by Commenting Out an Unfinished LineMedium
  50. 50.Fix and Tidy a Messy Python ProgramHard
  51. 51.Python Program to Greet the User by NameEasy
  52. 52.Python Program to Read Two Words and Make a SentenceEasy
  53. 53.Python Program to Add Two Numbers from InputEasy
  54. 54.Python Program to Find a Rectangle's Area from InputEasy
  55. 55.Python Program to Convert Celsius to Fahrenheit from InputMedium
  56. 56.Python Program to Calculate Age in MonthsEasy
  57. 57.Python Program to Split a Bill Between FriendsMedium
  58. 58.Python Program to Make a Shopping Receipt from InputHard
  59. 59.Python Program to Check If a Number Is PositiveEasy
  60. 60.Python Program to Apply a Discount on Orders Over 1000Easy
  61. 61.Python Program to Check If a Number Is Even or OddEasy
  62. 62.Python Program to Find the Larger of Two NumbersEasy
  63. 63.Python Program to Calculate a Grade from MarksMedium
  64. 64.Python Program to Check If a Number Is Between 1 and 100Easy
  65. 65.Python Program to Check If a Day Is a WeekendEasy
  66. 66.Python Program to Check If a Year Is a Leap YearMedium
  67. 67.Python Program to Check a Username and PasswordMedium
  68. 68.Python Program to Divide Two Numbers SafelyEasy
  69. 69.Python Program to Make a Simple ATMHard
  70. 70.Python Program to Create and Print a ListEasy
  71. 71.Python Program to Build a Seat List with + and *Medium
  72. 72.Python Program to Print the First and Last Item of a ListEasy
  73. 73.Python Program to Find the Day Name from Its NumberMedium
  74. 74.Python Program to Print the Top Three ScoresEasy
  75. 75.Python Program to Get the Last Few Temperatures from a ListMedium
  76. 76.Python Program to Add Items to a Shopping ListEasy
  77. 77.Python Program to Remove a Task by Its NumberMedium
  78. 78.Python Program to Check If an Item Is on the MenuEasy
  79. 79.Python Program to Make a Class Marks ReportHard
  80. 80.Python Program to Print Each Letter of a WordEasy
  81. 81.Python Program to Remove Spaces from a SentenceMedium
  82. 82.Python Program to Print Numbers from 1 to NEasy
  83. 83.Python Program to Print a Multiplication TableEasy
  84. 84.Python Program to Print a CountdownMedium
  85. 85.Python Program to Find the Sum of N NumbersEasy
  86. 86.Python Program to Count the Vowels in a WordMedium
  87. 87.Python Program to Find the Largest of N NumbersMedium
  88. 88.Python Program to Print a Star TriangleMedium
  89. 89.Python Program to Print Prime Numbers up to NHard
  90. 90.Python Program to Print Numbers from 1 to N Using a While LoopEasy
  91. 91.Python Program to Print a Countdown with a While LoopEasy
  92. 92.Python Program to Find the Sum of Digits of a NumberMedium
  93. 93.Fix the Endless Countdown LoopEasy
  94. 94.Python Program to Count the Weeks to Reach a Savings GoalMedium
  95. 95.Python Program to Add Numbers Until the User Types 0Easy
  96. 96.Python Program to Ask Again Until the Age Is ValidEasy
  97. 97.Python Program to Find the Largest Number Until done Is TypedMedium
  98. 98.Python Program to Count the Steps of the Collatz SequenceMedium
  99. 99.Python Program to Make a Number Guessing GameHard
  100. 100.Python Program to Print the First and Last Character of a StringEasy
  101. 101.Python Program to Check if a String Is a PalindromeMedium
  102. 102.Python Program to Clean Up a Name with strip() and title()Easy
  103. 103.Python Program to Count the Vowels in a SentenceMedium
  104. 104.Python Program to Check a Simple Email AddressMedium
  105. 105.Python Program to Count the Words in a SentenceEasy
  106. 106.Python Program to Reverse the Words in a SentenceMedium
  107. 107.Python Program to Format a Number with CommasEasy
  108. 108.Python Program to Print a Multiplication Table in ColumnsMedium
  109. 109.Python Program to Print a Neat Bill from Input LinesHard
  110. 110.Python Program to Create a Dictionary from InputEasy
  111. 111.Fix the Broken Phone Book DictionaryMedium
  112. 112.Python Program to Look Up a Phone NumberEasy
  113. 113.Python Program to Calculate a Fruit BillMedium
  114. 114.Python Program to Add or Update a Mark in a DictionaryEasy
  115. 115.Python Program to Remove an Item from a Shopping CartMedium
  116. 116.Python Program to Build a Price List from InputMedium
  117. 117.Python Program to Print a Menu from a DictionaryEasy
  118. 118.Python Program to Count Each Letter in a WordMedium
  119. 119.Python Program to Manage a Shop InventoryHard
  120. 120.Python Program to Find the Day Name from a Number Using a TupleEasy
  121. 121.Python Program to Find the Day of the Year Using a TupleMedium
  122. 122.Python Program to Swap Two Numbers Using Tuple UnpackingEasy
  123. 123.Python Program to Print a Marks Report from a List of TuplesMedium
  124. 124.Python Program to Count Unique Words in a SentenceEasy
  125. 125.Python Program to Find the First Repeated WordMedium
  126. 126.Python Program to Find Common Friends Using SetsMedium
  127. 127.Python Program to Convert a List into a Set and a TupleEasy
  128. 128.Python Program to Count Different Points Using a Set of TuplesMedium
  129. 129.Python Program to Make a Class Attendance ReportHard
  130. 130.Python Program to Print a Welcome Banner Using a FunctionEasy
  131. 131.Python Program to Draw a Box Using FunctionsMedium
  132. 132.Python Program to Find the Area and Perimeter Using a FunctionEasy
  133. 133.Python Program to Calculate a Bill with a Default TipMedium
  134. 134.Python Program to Print a Triangle Using a Function with ParametersMedium
  135. 135.Python Program to Convert Celsius to Fahrenheit Using a FunctionEasy
  136. 136.Python Program to Find the Largest of Three Numbers Using a FunctionMedium
  137. 137.Python Program to Check a Prime Number Using a FunctionMedium
  138. 138.Fix the NameError in a Python FunctionEasy
  139. 139.Python Program to Make a Marks Report Using FunctionsHard
  140. 140.Python Program to Rewrite Squashed Code in PEP 8 StyleEasy
  141. 141.Fix a Messy Python Program That Won't RunMedium
  142. 142.Python Program to Rename Unclear VariablesEasy
  143. 143.Fix a Variable That Hides a Python Built-in FunctionEasy
  144. 144.Python Program to Rename Functions and Constants in PEP 8 StyleMedium
  145. 145.Fix the Indentation in a Python FunctionEasy
  146. 146.Python Program to Break a Long Line of Code (PEP 8)Medium
  147. 147.Python Program to Replace Magic Numbers with Named ConstantsEasy
  148. 148.Python Program to Replace Repeated Code with a FunctionMedium
  149. 149.Python Program to Clean Up a Messy Report CardHard
  150. 150.Fix a TypeError in a Birthday MessageEasy
  151. 151.Fix a KeyError in a Price LookupMedium
  152. 152.Python Program to Double a Number with try and exceptEasy
  153. 153.Python Program to Split a Bill SafelyMedium
  154. 154.Python Program to Check Even or Odd with try, except and elseEasy
  155. 155.Python Program to Make a Ticket Machine with finallyMedium
  156. 156.Python Program to Check an Age with raiseEasy
  157. 157.Python Program to Withdraw Money with raiseMedium
  158. 158.Python Program to Keep Asking for a Valid AgeMedium
  159. 159.Python Program to Make a Safe CalculatorHard
  160. 160.Python Program to Find the Square Root Using the math ModuleEasy
  161. 161.Python Program to Find the GCD and LCM of Two NumbersMedium
  162. 162.Python Program to Find the Area and Circumference of a CircleEasy
  163. 163.Python Program to Find How Many Boxes You Need Using math.ceilEasy
  164. 164.Python Program to Find the Distance Between Two PointsMedium
  165. 165.Python Program to Roll Two Dice Using random.seedEasy
  166. 166.Python Program to Make a Random Number Guessing GameMedium
  167. 167.Python Program to Find the Number of Days Between Two DatesEasy
  168. 168.Python Program to Calculate Age from a Date of BirthMedium
  169. 169.Python Program to Make a Library Due Date and Fine CalculatorHard
  170. 170.Python Program to Save a Name in a File and Read It BackEasy
  171. 171.Python Program to Copy a Text FileMedium
  172. 172.Python Program to Write a Shopping List to a FileEasy
  173. 173.Python Program to Append Entries to a Diary FileMedium
  174. 174.Python Program to Read a File Line by LineEasy
  175. 175.Python Program to Count Lines and Words in a FileMedium
  176. 176.Python Program to Find a Word in a FileMedium
  177. 177.Fix the Python Program That Never Closes Its FileEasy
  178. 178.Python Program to Read a File Safely with try and exceptMedium
  179. 179.Python Program to Save and Load a Score ListHard
  180. 180.Python Program to Create a Class and an ObjectEasy
  181. 181.Python Program to Find the Older Pet Using ObjectsMedium
  182. 182.Python Program to Make a Student Class with __init__Easy
  183. 183.Python Program to Track a Game Character's HealthMedium
  184. 184.Python Program to Find Area and Perimeter Using a ClassEasy
  185. 185.Python Program to Make a Bank Account ClassMedium
  186. 186.Python Program to Print a Book Object Using __str__Easy
  187. 187.Python Program to Print a Shopping Cart of ObjectsMedium
  188. 188.Python Program to Make Animal Classes Using InheritanceMedium
  189. 189.Python Program to Build a Bank with Savings AccountsHard
  190. 190.Python Program to Play FizzBuzz from 1 to NEasy
  191. 191.Python Program to Reverse a StringEasy
  192. 192.Python Program to Reverse the Digits of a NumberEasy
  193. 193.Python Program to Find the Factorial of a NumberEasy
  194. 194.Python Program to Print the Fibonacci Series up to N TermsEasy
  195. 195.Python Program to Check If a Number Is an Armstrong NumberEasy
  196. 196.Python Program to Check If a Number Is a Perfect NumberEasy
  197. 197.Python Program to Count Uppercase, Lowercase, Digits and SpacesEasy
  198. 198.Python Program to Check If Two Words Are AnagramsEasy
  199. 199.Python Program to Check If a Sentence Is a PangramEasy
  200. 200.Python Program to Remove Duplicates from a List and Keep the OrderEasy
  201. 201.Python Program to Count How Many Times a Number Appears in a ListEasy
  202. 202.Python Program to Count Positive, Negative and Zero Numbers in a ListEasy
  203. 203.Python Program to Check If a List Is SortedEasy
  204. 204.Python Program to Find the Second Largest Number in a ListMedium
  205. 205.Python Program to Find the Missing Number from 1 to NMedium
  206. 206.Python Program to Find the Numbers That Appear More Than OnceMedium
  207. 207.Python Program to Find the Most Common Character in a StringMedium
  208. 208.Python Program to Remove Repeated Characters from a StringMedium
  209. 209.Python Program to Check If a Sentence Is a Palindrome Ignoring SpacesMedium
  210. 210.Python Program to Find the Longest Word in a SentenceMedium
  211. 211.Python Program to Count How Often Each Word AppearsMedium
  212. 212.Python Program to Merge Two Sorted Lists Without sort()Medium
  213. 213.Python Program to Rotate a List by K PlacesMedium
  214. 214.Python Program to Find the Items Two Lists Have in CommonMedium
  215. 215.Python Program to Find Two Numbers That Add Up to a TargetMedium
  216. 216.Python Program to Compress a String with Letter CountsMedium
  217. 217.Python Program to Move All Zeros to the End of a ListMedium
  218. 218.Python Program to Check If Brackets Are BalancedHard
  219. 219.Python Program to Find the First Character That Does Not RepeatHard
  220. 220.Python Program to Group Words That Are AnagramsHard
  221. 221.Python Program to Find the Longest Part Without Repeated LettersHard
  222. 222.Python Program to Find the Largest Sum of a Run of NumbersHard
  223. 223.Python Program to Convert a Number to Roman NumeralsHard
  224. 224.Python Program to Convert Roman Numerals to a NumberHard
  225. 225.Python Program to Find a Number with Binary SearchHard
  226. 226.Python Program to Sort a List with Bubble SortHard
  227. 227.Python Program to Transpose a MatrixHard
  228. 228.Python Program to Find the Longest Common Start of WordsHard
  229. 229.Python Program to Hide a Message with a Caesar CipherHard
  230. 230.Python Program to Calculate an Electricity Bill with Price SlabsEasy
  231. 231.Python Program to Calculate BMI and Show Its CategoryEasy
  232. 232.Python Program to Calculate a Parking Fee by HoursEasy
  233. 233.Python Program to Find a Movie Ticket Price by Age and DayEasy
  234. 234.Python Program to Calculate the Fuel Cost of a TripEasy
  235. 235.Python Program to Convert Money with Fixed Exchange RatesEasy
  236. 236.Python Program to Calculate a Monthly Loan PaymentEasy
  237. 237.Python Program to Make a Salary Slip with Net PayEasy
  238. 238.Python Program to Scale a Recipe for More PeopleEasy
  239. 239.Python Program to Check How Strong a Password IsEasy
  240. 240.Python Program to Make a Unit Converter MenuEasy
  241. 241.Python Program to Make a Weekly Step CounterEasy
  242. 242.Python Program to Check If a Shop Is OpenEasy
  243. 243.Python Program to Find a Gym Membership Price with OffersEasy
  244. 244.Python Program to Make a To-Do List with CommandsMedium
  245. 245.Python Program to Make a Contact Book with CommandsMedium
  246. 246.Python Program to Make a Quiz Game That Gives a ScoreMedium
  247. 247.Python Program to Count Votes and Find the WinnerMedium
  248. 248.Python Program to Track Expenses by CategoryMedium
  249. 249.Python Program to Book Cinema Seats with a Seat MapMedium
  250. 250.Python Program to Book Train Tickets with a Waiting ListMedium
  251. 251.Python Program to Make a Game LeaderboardMedium
  252. 252.Python Program to Rank Students by PercentageMedium
  253. 253.Python Program to Apply Coupon Codes to a Shopping CartMedium
  254. 254.Python Program to Lend and Return Library BooksMedium
  255. 255.Python Program to Make a Weekly Weather SummaryMedium
  256. 256.Python Program to Count the Floors a Lift TravelsMedium
  257. 257.Python Program to Book Hotel Rooms with Check-In and Check-OutMedium
  258. 258.Python Program to Make a Wallet App with TransfersHard
  259. 259.Python Program to Find the Winner of Tic-Tac-ToeHard
  260. 260.Python Program to Play Snakes and Ladders with Given Dice RollsHard
  261. 261.Python Program to Make a Vending Machine That Gives ChangeHard
  262. 262.Python Program to Make a Parking Lot with ClassesHard
  263. 263.Python Program to Make a Hospital Queue with Emergencies FirstHard
  264. 264.Python Program to Calculate Payroll with Overtime and TaxHard
  265. 265.Python Program to Total Each Column of a Mini SpreadsheetHard
  266. 266.Python Program to Run a Rock-Paper-Scissors TournamentHard
  267. 267.Python Program to Give Each Food Order to the Nearest RiderHard
  268. 268.Python Program to Print a Calendar MonthHard
  269. 269.Python Program to Check a Sign-Up Form and Show Every ErrorHard
  270. 270.Python Program to Print a Square of StarsEasy
  271. 271.Python Program to Print a Number TriangleEasy
  272. 272.Python Program to Print a Row-Number TriangleEasy
  273. 273.Python Program to Print an Upside-Down Star TriangleEasy
  274. 274.Python Program to Print a Right-Aligned Star TriangleEasy
  275. 275.Python Program to Print a Hollow SquareEasy
  276. 276.Python Program to Print a Letter TriangleEasy
  277. 277.Python Program to Print Letter RowsEasy
  278. 278.Python Program to Print a Chessboard PatternEasy
  279. 279.Python Program to Print Floyd's TriangleEasy
  280. 280.Python Program to Print a 0 and 1 TriangleEasy
  281. 281.Python Program to Print a Countdown Number TriangleEasy
  282. 282.Python Program to Print a Plus Sign of StarsEasy
  283. 283.Python Program to Print a Name Banner in a BoxEasy
  284. 284.Python Program to Print a Star PyramidMedium
  285. 285.Python Program to Print an Upside-Down Star PyramidMedium
  286. 286.Python Program to Print a Diamond of StarsMedium
  287. 287.Python Program to Print a Hollow TriangleMedium
  288. 288.Python Program to Print a Palindrome Number PyramidMedium
  289. 289.Python Program to Print Pascal's TriangleMedium
  290. 290.Python Program to Print an Hourglass of StarsMedium
  291. 291.Python Program to Print a Butterfly PatternMedium
  292. 292.Python Program to Print an X PatternMedium
  293. 293.Python Program to Find the Digital Root of a NumberMedium
  294. 294.Python Program to Check If a Number Is a Strong NumberMedium
  295. 295.Python Program to Check If a Number Is a Happy NumberMedium
  296. 296.Python Program to Turn a Number into Binary by HandMedium
  297. 297.Python Program to Find the Next Palindrome NumberMedium
  298. 298.Python Program to Print a Hollow DiamondHard
  299. 299.Python Program to Print a Zigzag PatternHard
  300. 300.Python Program to Print a Number SpiralHard
  301. 301.Python Program to Find Twin Primes in a RangeHard
  302. 302.Python Program to Count the Steps of Kaprekar's RoutineHard
  303. 303.Python Program to Check a Magic SquareHard
  304. 304.Python Program to Print the Moves of the Tower of HanoiHard
  305. 305.Python Program to Write a Number in WordsHard
  306. 306.Python Program to Check a Sudoku GridHard
  307. 307.Python Program to Print the Look-and-Say SequenceHard
  308. 308.Python Program to Play One Step of the Game of LifeHard
  309. 309.Python Program to Find the Angle Between Clock HandsHard

Showing 309 of 309 questions