A Collection Of Simple Python Programs Designed For Practice And Learning. Perfect For Beginners.
1. Personal Information
Write a program that displays the following information:
• Your name
• Your address, with city, state, and ZIP
• Your telephone numbers
• Your college major
Click Here For Solution2. Loan Qualifier
Program to determine whether a bank customer qualifies for a loan.
Click Here For Solution3. Day of the Week
Write a program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of the week, where 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, and 7 = Sunday. The program should display an error message if the user enters a number that is outside the range of 1 through 7.
Click Here For Solution4. Areas of Rectangles
The area of a rectangle is the rectangle’s length times its width. Write a program that asksfor the length and width of two rectangles. The program should tell the user which rectangles the greater area, or if the areas are the same.
Click Here For Solution5. Age Classifier
Write a program that asks the user to enter a person’s age.
The program should display a message indicating whether the person is an infant, a child, a teenager, or an adult.
Following are the guidelines:
• If the person is 1 year old or less, he or she is an infant.
• If the person is older than 1 year, but younger than 13 years, he or she is a child.
• If the person is at least 13 years old, but less than 20 years old, he or she is a teenager.
# • If the person is at least 20 years old, he or she is an adult.
Click Here For Solution6. List Operations
Program demonstrates create list, append, insert, remove, sort, copy, how to get the index of an item in a list and then replace that item with a new item.
Click Here For Solution7. Program to Demonstrate Use of Tuples
Write A Program To Demonstrate Use Of Tuples.
Click Here For Solution8. Program Demonstrates List and Dictionary Operations
Create A Program That Demonstrates The Following Tasks: Creating A List, Appending, Inserting, Removing, Sorting, And Copying Elements Within The List, Accessing Elements In A Dictionary, And Working With Strings.
Click Here For Solution9. Sales Commission Program
Create A Program That Calculates Sales Commissions.
Click Here For Solution10. Program Using Range Function with For Loop
Write A Program That Demonstrates How The Range Function Can Be Used With A For Loop.
Click Here For Solution11. Print Asterisks in a Triangle Pattern
Create A Program That Print Asterisks In A Pattern That Looks Like The Triangle.
Click Here For Solution12. Program to Navigate Different Data Structures
Create A Program To Navigate In Different Data Structures.
Click Here For Solution13. Program to Write Three Lines of Data to a File
Write A Program That Writes Three Lines Of Data To A File.
Click Here For Solution14. Program to Create Car and Employee Class
Write A Program To Create Car And Employee Class.
Click Here For Solution15. Class With Initializer
Write A Program To Create Class With Initializer.
Click Here For Solution16. Create Object And Use It
Write A Program To Create Object Of Class And Use It.
Click Here For Solution17. Inherit From Parent Class
Write A Program To Inherit One Class From Parent.
Click Here For Solution18. Program Demonstrates Polymorphism
Write A Program That Demonstrates Polymorphism.
Click Here For Solution19. File Operations
Write A Program To Open A File And Ask The User To Input The Filename.
If The File Exists, Display The Content Of The File,
Else Create A File And Write The Line “File Is Opened In Write Mode”.
Click Here For Solution