Skip to content

DoIT-Technical-Club/Python-Practice-problems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Octocat HacktoberFest 2023 Octocat

Python Practice-Problems

Welcome to Hacktoberfest 2023 Contribution Repository! The Python Average-Problems-Practice Repository! This repository is a hub for Python enthusiasts and problem solvers. Here, you will find a list of interesting Python challenges and questions that you can tackle. We encourage you to not only use this repository to enhance your Python skills but also to contribute your solutions and insights to help others learn and grow.

Looking to contribute with some high-quality code? You're in the right place!

Check out the Guidelines

Feel free to edit this README to make it more attractive and informative!

logo

Python is a versatile and powerful programming language, and problem-solving is an essential skill for every developer. This repository aims to provide a collection of Python problems that cover a wide range of difficulty levels, from beginner to advanced.

List of problems

We have categorized problems into various domains to cater to a wide range of interests and skill levels. Some of the categories include:

  • Algorithms and Data Structures: Challenges related to sorting, searching, graphs, and more.
  • Mathematics: Problems involving mathematical concepts and operations.
  • String Manipulation: Tasks that require working with strings and text processing.
  • Python Fundamentals: Questions to test your understanding of Python's core features.

Feel free to explore these categories and choose problems that align with your interests and expertise.

Here is the list of Python programming questions you can work on:

Question 1: Write a python program to print Hello word!.()
Question 2: Write a Python program to print sum of two no.
Question 3: Write a Python program to print 100 times Happy Birthday and infinite time using for & While Python loops.
Question 4: Write a Python program to read no. from keyboard and detect given no. is prime, odd, even and composite no.
Question 5: Write a Python program to convert any no. up to 9 digit into Roman No.
Question 6: Write a Python program to insert commas suitable & write the names according to Indian and international system of numeration of any given no. by the keyboard.
Question 7: Write a Python program to print table of any given no.
Question 8: Write a Python program to print1 to 100 –increasing order and decreasing order 100 to 1 using for & while loops.
Question 9: Write a Python program to print a to z – increasing order and decreasing orderz to a using For & While loops.
Question 10: Write a Python program to compute greater no. from given three no.
Question 11: Write a Python program to swap/exchange value of a & b.
Question 12: Write a Python program to define conditional (? :) operator.
Question 13: Write a Python program to computer arithmetical operations.
Question 14 : Write a Python program to computer vowel and consonant from given character using nested if statement.
Question 15 : Write a Python program to compute factorials of any given no. (0!=1)
Question 16 : Write a Python program to calculate area of circle, triangle, Rectangle, square.
Question 17 : Write a Python program to show trigonometry table. (sin, cos, tan, sec, cosec, cot and angle are 0,30,45,60 and 90 degree).
Question 18 ::Write a Python program to calculate power of no. (xy)
Question 19: Write a Python program to print and sum of Fibonacci series for a given value of n. 0,1,1,2,3,5,8,13,21, ……..,n
Question 20: Write a Python program to show instance variable, class variable and local variable.
Question 21: Write a Python program to convert the given temperature in Fahrenheit to Celsius and Kelvin and vice versa forgetting input from the user. And display the values in a tabular form.
▪ C/5 = (F-32)/9 = K-273/5
Question 22 : Write a Python program to explain relational operator with the help of example.
Question 23: Write a Python program to explain logical operator with the help of example.
Question 24: Write a Python program to explain switch statement with the help of example.
Question 25: Write a Python program to explain break statement with the help of example using For & While loops.
Question 26: Write a Python program to explain continue statement with the help of example using For, While loops & For pass.
Question 27: Write a Python program to explain conditional operator with the help of example.
Question 28: Write a Python program to determine the sum of the following harmonic series for a given value of n
1+1/2+1/3+…….+1/n
Question 29: Write a Python program to add for a given value of n terms of the following series using for loop – Break, continue and else statement. 1/1!+2/2!+3/3!+ ………….
Question 30: Write a Python program to test whether a number given is positive or not.
Question 31: Write a Python program to obtain the age of a person and tell whether the person is eligible voter or not.
Question 32: Write a Python program to obtain principal amount, and time and then calculator simple interest as per following specifications:
Question 33: If principal is greater than or more then Rs.10000, then rate of interest is 6% otherwise it is 5%.
Question 34: Write a Python program to obtain principal amount and time and calculate simple interest as per following rates of interest. ▪ Principal Amount
• <10000
• >=10000 - < 20000
• >=20000 - <50000
• >=50000
rate of Interest 5%, 6.5%, 8.5%, 10%
Question 35: Write a Python program to print first natural number and their sum.
Question 36: Write a Python program to print even number between 50 and 100 using For & While loops.
Question : Write a Python program to print the sum of following series using For & While loops. ➢ 1+1/4+1/7+1/10+1/13+1/16+1/19+1/22+1/25+ …..+1/n
Question 37: Write a Python program to accept two numbers and print the numbers falling between the two given numbers.
Question 38: Write a Python program to count the numbers entered and calculates their average. The loop should terminate when zero (0) is entered.
Question 39: Write a Python program to print first n squares lesser than 50 using For & While loops.
Question 40: Write a Python program to find the number of and sum of all integers greater than 100 and less than 200 that are divisible by 7.
Question 41: Write a Python program tocount number of words given on command line argument.
Question 42: Write a Python program to print following patterns using For & While loops.
Read no. of rows from key board.
Program to print half pyramid a using numbers
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Program to print half pyramid using alphabets
A
B B
C C C
D D D D
E E E E E
Programs to print inverted half pyramid using * and numbers Inverted half pyramid using *

          • \
        • \
      • \
    • \
  • \

Inverted half pyramid using numbers
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
Question 43: Write a Python program to print following patterns as full pyramid using For & While loops. Read no. of rows from key board.
Programs to display pyramid and inverted pyramid using * and digits Program to print full pyramid using *
\ *
\ * * *
\ * * * * *
\ * * * * * * *
* * * * * * * * *
Program to print pyramid using numbers

    1 
  2 3 2 
3 4 5 4 3 

4 5 6 7 6 5 4 5 6 7 8 9 8 7 6 5 Inverted full pyramid using *



* * * * * 
  * * * 
    * 

Print Pascal's triangle

       1 
     1   1 
   1   2   1 
 1   3   3    1 

Print Floyd's Triangle.

1
2 3
4 5 6
7 8 9 10
Question 45: Write a Python program to reverse of number using For & While loops
Feel free to add more questions and solutions as you see fit.

Note -> For File Formate.

1.File Name Format: Name your solution files in the following format:-

1. sol001.c for the first problem's solution.
2. sol002.c for the second problem's solution.
3. sol003.c for the third problem's solution.
And so on...

2.Leading Zeros:- Ensure that the solution file names include three digits, with leading zeros if necessary. For example, the tenth problem's solution should be named sol010.c.

Coding Guidelines

To maintain consistency and readability in the repository, please follow these coding guidelines:

  • Use meaningful variable and function names.
  • Provide comments to explain your code, especially for complex solutions.
  • Follow Python's PEP 8 style guide for code formatting.
  • Ensure your code is efficient and well-optimized.
  • Include a brief explanation of your approach in your solution's README file.

Contributing to Hacktoberfest2023

Hacktoberfest is an annual celebration of open-source contributions. This year, it runs from October 1st to October 31st, and you can be a part of it!

If you're new to open source or an experienced contributor, Hacktoberfest is a fantastic opportunity to make meaningful contributions to projects you care about. Here's how you can get started:

  1. Find Projects: Explore open-source projects you're passionate about. Check if they have issues labeled "Hacktoberfest" to get started.

  2. Start Contributing: Pick an issue you'd like to work on or create your own if you have a great idea. Then, fork the repository, make your changes, and submit a pull request.

  3. Quality Matters: Ensure your contributions are of high quality. Follow project guidelines and coding standards.

  4. Review and Collaborate: Collaborate with maintainers and reviewers during the pull request process. Be responsive to feedback and make necessary improvements.

  5. Celebrate: After your pull requests are accepted, you're on your way to earning a limited-edition Hacktoberfest shirt!

Get Started

Ready to dive in? Explore our Hacktoberfest Issues to find tasks you can work on right away.

Remember, Hacktoberfest is not just about quantity but also quality contributions. Make a positive impact on the open-source community!

Hacktoberfest 2023

Organizer

This repository is maintained by krishnapatidar458. If you have any questions or need assistance, feel free to reach out.

Let's make Hacktoberfest 2023 memorable together! 🚀

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

This is the text of the GNU General Public License, version 3.0 (GPL-3.0).

You can find the full text of the GPL-3.0 license on the GNU website: GPL-3.0 License Text.

The GPL-3.0 license is a widely used open-source license that grants users the freedom to use, modify, and distribute software covered by this license. It includes provisions to ensure that derivative works are also open source and provides protections for users' freedom.

Please make sure to review the full text of the GPL-3.0 license to understand its terms and conditions before using or contributing to this software.

Summary of Key Points

  • You are free to use, modify, and distribute this software.

  • If you distribute derivative works, those works must also be licensed under the GPL-3.0 or a compatible license.

  • This software is provided "as is" with no warranty.

For detailed information about your rights and responsibilities under the GPL-3.0 license, please read the full license text linked above.


Note: The text above provides a brief overview of the GPL-3.0 license. It does not constitute legal advice. If you have legal questions or concerns about licensing, please consult with legal counsel.