python projects with source code for beginners

-Guess The Number. Write a programme
 where the computer randomly generates
 a number between 0 and 20
-Rock, Paper, Scissors Game
-Tic Tac Toe
-Password Generator
-Hangman
-Binary Search Algorithm

3.8
5
Spidy776 70 points

                                    #Password generator 

import random
import string

letters = string.ascii_letters
print('Your brand new password is:')
print (''.join(random.choice(letters) for i in range(12)))

3.8 (5 Votes)
0
4.14
7
Wo0dy 90 points

                                    ##-Guess The Number. Write a programme
## where the computer randomly generates
##a number between 0 and 20

from random import randint
    
print("Hey there! In this game, you will have to guess a random number from 1, 20. Good luck!")
user_name = input("What's your name?\n")

print(user_name,"pick a number!")
guess = input()

random_int = randint(0, 20)

if guess != random_int:
    print('That was wrong!', random_int, "was the number!")
else: 
    print('That was correct!')

4.14 (7 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source