0% found this document useful (0 votes)
5 views5 pages

Basicpython Questionnaire

The document outlines a series of programming challenges that involve basic game mechanics and input classification. Each challenge includes specific rules and outcomes based on user input or random number generation. The tasks range from guessing games and number classification to simulations and calculators.

Uploaded by

licako4250
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views5 pages

Basicpython Questionnaire

The document outlines a series of programming challenges that involve basic game mechanics and input classification. Each challenge includes specific rules and outcomes based on user input or random number generation. The tasks range from guessing games and number classification to simulations and calculators.

Uploaded by

licako4250
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

Lucky Number Guessing Game

Generate a random number between 1 and 100. Ask the user to guess the
number.

 If the guess is correct, print "You Win!"

 If the guess is within 10 of the number, print "Very Close!"

 If the guess is more than 20 away, print "Too Far!"

2. Number Classifier

Take an integer input and classify it as:

 "Positive Even" if positive and even

 "Positive Odd" if positive and odd

 "Negative Even" if negative and even

 "Negative Odd" if negative and odd

 "Zero" if the number is 0

3. Random Dice Game

Simulate rolling two dice using randint(1, 6).

 If both dice are the same, print "Double!"

 If their sum is 7 or 11, print "Lucky Win!"

 Otherwise, print the sum of the dice.

4. Grade Calculator

Take a student's score (0-100).

 ≥ 90: "A"

 80-89: "B"

 70-79: "C"

 60-69: "D"

 < 60: "F"

 If the score is invalid, print "Invalid Input"


5. Rock, Paper, Scissors

Create a game where the computer randomly selects rock, paper, or


scissors. Compare the user's choice and determine the winner.

6. Triangle Validator

Take three side lengths.

 Check if they form a valid triangle.

 If valid, classify it as "Equilateral," "Isosceles," or "Scalene."

7. Leap Year Checker

Given a year, check if it is a leap year:

 Divisible by 4

 Not divisible by 100 unless divisible by 400

8. Random Number Battle

Generate two random numbers between 1 and 50:

 If the first is greater, print "Player 1 Wins"

 If the second is greater, print "Player 2 Wins"

 If equal, print "It's a Tie!"

9. Number Guessing with Attempts

Generate a random number between 1 and 50. Allow the user 5 attempts
to guess the number.

 Give hints ("Too High"/"Too Low") after each guess.

 If the guess is correct, print "Congratulations!"

10. Age Group Classifier

Take the user's age and classify them:

 0-12: "Child"
 13-19: "Teenager"

 20-64: "Adult"

 65 and above: "Senior Citizen"

11. Pass or Fail

Take marks for three subjects.

 If all marks are ≥ 40, print "Pass"

 If any mark is < 40, print "Fail"

 If total ≥ 150, print "Passed with Distinction"

12. Random Lottery Simulator

Generate a random 4-digit number. Ask the user to enter a guess:

 If all digits match, print "Jackpot!"

 If two digits match, print "Second Prize"

 Otherwise, print "Better Luck Next Time"

13. Odd or Even Predictor

Generate a random number between 1 and 100.

 If the number is even and ≤ 50, print "Low Even"

 If the number is odd and > 50, print "High Odd"

14. Weather Suggestion System

Take temperature as input:

 ≤ 0°C: "Stay Warm Inside"

 1-20°C: "Wear a Jacket"

 21-35°C: "Nice Weather"

 35°C: "Stay Hydrated"

15. Magic Number Comparison


Generate two random numbers between 1 and 100.

 If both are even, print "Double Even!"

 If both are odd, print "Double Odd!"

 If one is even and the other odd, print "Mixed Pair"

16. Random Day of the Week

Generate a random number (1-7) representing the days of the week:

 1: "Monday"

 7: "Sunday"

 If it’s 6 or 7, print "Weekend!"

17. Chessboard Square Color

Given a position like "a1", determine if the square is black or white.

18. BMI Calculator

Take weight (kg) and height (m). Calculate BMI using:


BMI = weight / (height * height)

 < 18.5: "Underweight"

 18.5-24.9: "Normal"

 25-29.9: "Overweight"

 ≥ 30: "Obese"

19. Random Character Generator

Generate a random lowercase letter and determine if it is a vowel or


consonant.

20. Number Divisibility Game

Take a number from the user:

 If divisible by both 3 and 5, print "FizzBuzz"

 If only by 3, print "Fizz"


 If only by 5, print "Buzz"

 Otherwise, print the number

You might also like