12 Beginner Python Projects - Coding Course

freeCodeCamp.org · 5M views · 2020 · 3:00:29

Open on YouTube

Python, Ruby & scripting languagesEducation & learningcourse

Why Stack Overflow recommends it

Stack Overflow users cite it as the tutorial they were following when they hit bugs in Hangman, binary search, number guessing and rock paper scissors projects.

Recommended by 0 people across 0 different months, 2022 to 2023.

What it is

A three-hour freeCodeCamp course by Kylie Ying that walks through 12 beginner Python projects, including Madlibs, Hangman, Tic-Tac-Toe with an AI, Minesweeper, a Sudoku solver, photo manipulation and a Markov chain text composer. Each project is coded live with accompanying GitHub repositories.

What people said

Cites ben seaman · 2022-05 · Stack Overflow · on “Python program runs but finishes with exit code 0”

I'm trying to learn Python by following this tutorial [this video] on YouTube. I've followed along and written the code, yet when I run it, the program finishes instantly without inputting into the console. Here's my code: import random def play(): user = input("'r' for rock, 'p' for paper, 's' for scissors") computer = random.choice(['r', 'p', 's']) if user == computer: return 'Its a tie!' # r > s, s > p, p > r if is_win(user, computer): return 'You won!' return "You lost!" def is_win(player, opponent): # return true is player wins # r > s, s > p, p > r if (player == 'r' and opponent == 's') or (player == 's' and opponent == 'p') \ or (player == 'p' and opponent == 'r'): return True And this is

Cites Jeewanthi Wijesinghe · 2022-07 · Stack Overflow · on “Python script executes without any error but cannot take user input”

I'm new to python and this is code for hangman. randomly taking a word and user is guessing the letters odf the word. This was one of problem from 12 beginner python project of freeCodeCamp.org video.In the video it shows no problem. but when I'm running this i get no error but no output as well. import random from words import words import string def get_valid_word(words): word = random.choice(words) # randomly chooses something from the list while '_' in word or ' ' in word: word = random.choice(words) return word.upper() def main(): word = get_valid_word(words) word_letters = set(word) # letters in the word alphabet = set(string.ascii_uppercase) used_letters = set() # what user has guesse

Cites JellyTree · 2022-07 · Stack Overflow · on “Segmentation fault: 11 / RecursionError: maximum recursion depth exceeded while calling a Python object”

for my project, I am coding a binary search function (this is my first project!) However, when I try to implement a list that is >= 10, I get the recursion error. By looking at some answers in this site, I've roughly learned and am assuming python sets a recursion limit so that it will prevent stack overflow. So I implemented someone's solution: import sys sys.setrecursionlimit(100000) which lead to the following error: Segmentation fault: 11 Here is my code: import random import time import sys sys.setrecursionlimit(100000) # Implementation of binary search algorithm # Proving that binary search is faster than naive search # naive search: scan entire list and ask if it's equal to the target

Cites best l · 2022-09 · Stack Overflow · on “How can I import words from a document into my python file?”

[Pycharm] Hi, I am very new to programming and I wanted to make the Hangman game in python. I want to import words from the dictionary. In that way the computer chooses a random word, and the user have to guess it. It is this video I am following: [this video] In this video she imported a words list, that she used. However I want to make one in my language. I found one online dictionary who shares their data files, and it is a tar file. enter image description here [LINK] The words are behind the dash - in the list. How can I retrieve only these words? and how do i import these words into my python file. enter image description here [LINK]

Cites matti · 2023-02 · Stack Overflow · on “how is high and low not changing with user input”

doing project from this youtube vedio and it does not seem to be working. [this video] the finish coode is at 19:49 my problem is when I run it low says at 1 and high says at 100. any help would be welcome. def computer_guess(x): low=1 high=x feedback='' while feedback!='c': print(f'high:{high} low:{low} feedback:{feedback}') if low !=high: guess=random.randint(low,high) else: guess=low feedback=input(f'Is the {guess} to high(h),to low(l), or correct(c)?? ').lower if feedback=='h': high=guess-1 elif feedback=='l': low=guess+1 print(f'yay, the comptuer geussed the number, {guess},correctly!') computer_guess(100) i was expecting was low and hight to change.