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
#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)))
Thank you!
5
0
4.14
7
##-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!')
Thank you!
7
0
Are there any code examples left?
New code examples in category Python
-
Python 2023-04-11 03:04:20
-
Python 2022-03-27 22:40:04 pycharm no module named
-
Python 2022-03-27 22:25:05 assign multiple variablesin one line
-
Python 2022-03-27 22:20:02 levenshtein distance
-
Python 2022-03-27 21:35:09 get text from url python last slash
-
Python 2022-03-27 21:30:30 df concatenate df
-
Python 2022-03-27 21:25:09 python odd or even
-
Python 2022-03-27 21:15:32 python include function from another file
-
Python 2022-03-27 21:10:01 color module python
-
Python 2022-03-27 21:00:27 python tkinter cursor types