Тёмный

The Ultimate 25 Minute Python Project! 

Tech With Tim
Подписаться 1,5 млн
Просмотров 67 тыс.
50% 1

Today, I'll be showing you a quick Python project that you can work on to hone and practice your skills, while learning some new Python features!
💻 Start scanning your code with CodeSec by Contrast Security for free! bit.ly/3VLR0P0
💻 Master Blockchain and Web 3.0 development today by using BlockchainExpert: algoexpert.io/blockchain - use code "tim" for a discount!
💻 ProgrammingExpert is the best platform to learn how to code and become a software engineer as fast as possible! programmingexpert.io/tim - use code "tim" for a discount!
⭐️ Timestamps ⭐️
00:00 | The Ultimate Python Project
01:00 | Project Demo
04:20 | Project Walkthrough
27:28 | Running the Project!
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
👕 Merchandise: teespring.com/stores/tech-wit...
📸 Instagram: / tech_with_tim
📱 Twitter: / techwithtimm
⭐ Discord: / discord
📝 LinkedIn: / tim-ruscica-82631b179
🌎 Website: techwithtim.net
📂 GitHub: github.com/techwithtim
🔊 Podcast: anchor.fm/tech-with-tim
🎬 My RU-vid Gear: www.techwithtim.net/gear/
💵 One-Time Donations: www.paypal.com/donate?hosted_...
💰 Patreon: / techwithtim
◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
⭐️ Tags ⭐️
- Tech With Tim
- Python Development
- Coding
⭐️ Hashtags ⭐️
#techwithtim #developer #python #howtolearncoding

Опубликовано:

 

9 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 108   
@benjohnston3369
@benjohnston3369 Год назад
As a beginner, some of this goes over my head, but the language is slowly starting to make sense thanks to your videos! Thanks for making them.
@TechWithTim
@TechWithTim Год назад
Happy to help!
@user-wz3zi3fv9y
@user-wz3zi3fv9y Год назад
Life is crazy, i first started watching your python tutorials when i was 15 back when you didn’t even show your face, fast forward 5 years later i got into CS because of you.. now being in my third year of uni and i still come back to your channel for help. You don’t know me but I have a lot to thank you for😭
@joannatrafna164
@joannatrafna164 11 месяцев назад
hey Tim, I am a data analyst struggling with Python but your videos helped me so much to understand how Python works! Thank you so much for sharing! You are a brill teacher!
@ahmedalsaedi3849
@ahmedalsaedi3849 Год назад
This project is rich with logic and algo that are used to solve interview questions. Highly recommend watching more then once.
@georgiosvaronos9148
@georgiosvaronos9148 Год назад
Thank you mate for all your videos. Really like those Project videos, learning something new every time. Keep up the good work you are doing.
@AliAliOxenFree
@AliAliOxenFree 11 месяцев назад
man you did a fantastic job in this video describing a situation that is difficult to describe (but is not exceedingly complicated, logic wise). You're a talented teacher!
@adityabhambhani207
@adityabhambhani207 Год назад
you're a legend Tim! what a fun experience i had while doing this...there really is an elegance about programming and oh boy do i love it!
@seyu8666
@seyu8666 Год назад
Thank you so much for this. As someone who knows python but never really kind of mastered it this is really helpful in regaining the confidence in my learnings. Please make more of such projects
@alimihakeem841
@alimihakeem841 Год назад
Thanks so much Tim for all the beneficial videos. Have really learn alot from it.
@bombus1340
@bombus1340 Год назад
I replicated the code exactly (exept for using letters A-F instead of colours) and ran into a bug. After checking the correct positions, the second for-loop doesn't know which letters of the guessed code have already been used to find correct positions. Therefore the second loop goes over all letters in the guessed code again and compares them to the remaining actual code letters in the counts dict. If one of the remaining letters is identical to one of the guessed letters in the correct position, it uses that letter again for the incorrect position. Here is an example, because I think my description sucks: If the correct code is ECCD and you guess ECFD, the game prints 3 correct guesses and 1 incorrect guess (which doesn't make any sense). A workaround is to add "if guess_color != real_code" into the if-condition of the second for-loop. I hope this makes some sense lol
@vedantsgoodlife7302
@vedantsgoodlife7302 Год назад
This is a good way to learn. Please keep posting such videos.
@mathewhunter7826
@mathewhunter7826 Год назад
Hi Tim. Another solid video and project. I liked it so much and also tried a different way to write the program. I used a binary np array to code the color/position of a guess/target. Then used some mathematical functions to calculate correct/incorrect values. One of the things I really like about coding is the idea that there are many ways to write/solve a problem. With your videos I am learning to write to the point that I can explore different ways. Although, they are not very clean. With time they will be. Thanks for another great video! Looking forward to more!
@ayatr26
@ayatr26 10 месяцев назад
Thanks, you helped me break down this problem for my students. Really appreciate it!
@bzwiv8021
@bzwiv8021 Год назад
Thanks Tim, this content is always useful.
@ehsanulhaqueraiyan8681
@ehsanulhaqueraiyan8681 9 месяцев назад
I’m liking this type short project video because it is more enjoyable to learn programming with projects. hope u will bring more
@jimrobinson1963
@jimrobinson1963 Год назад
Great set of videos, thanks Tim.
@Abdulla_tech
@Abdulla_tech Год назад
Since building the space invaders game with you 3 months ago and understanding nothing, I now understanding 90% of whats going on here and feel so proud. Thanks Tim!
@hussnainkhan900
@hussnainkhan900 Год назад
I really enjoy your projects. You are such a blessing for Beginners. I really enjoy your vides so much. I just want to say : THANK YOU SO MUCH FOR SUCH A GREAT CONTENT.
@paulthomas1052
@paulthomas1052 Год назад
Great project - Thanks.
@hassanarjmandnia
@hassanarjmandnia 8 месяцев назад
that was a very very good video, thank u for making all of this awesome video. i hope u make more and more of this python projects video ( especially for intermediate level ) because they are very helpful. tnx again tim.
@murphygreen8484
@murphygreen8484 Год назад
I love these videos, and this is very beginner friendly, but so much of this seems to be done much more difficultly than it needed to be
@murphygreen8484
@murphygreen8484 Год назад
I can share my equally beginner code if interested?
@mariumbegum7325
@mariumbegum7325 Год назад
Very useful content, great work!
@mangeurdecowan
@mangeurdecowan Год назад
I never knew "else" could be used with a "for" loop. Nice!!
@elahekhatoonabadi7402
@elahekhatoonabadi7402 Год назад
It’s awesome .thank you
@harishsanthosh3861
@harishsanthosh3861 Год назад
You are amazing my python skills are grow with yoy thank you bro❤
@DVDY-ih8wi
@DVDY-ih8wi 7 месяцев назад
cool example, well explained!
@ithinkthereforeitalk935
@ithinkthereforeitalk935 Год назад
Totally digging your new look. Brutal-looking bro with a beard. Yep, you gotta grow a pair, gotta toughen up , gotta hold your ground against ubiquitous Chat Gpt :).
@TechWithTim
@TechWithTim Год назад
lmao, exactly why i grew it out ;)
@adventuresofavalon2477
@adventuresofavalon2477 Год назад
Love such projects like this! Keep them coming
@TechWithTim
@TechWithTim Год назад
That’s the plan!
@RedFox-ew8ek
@RedFox-ew8ek Год назад
Hey Tim, your tutorials is very wonderful, comprehensive and realistic to a beginner like me, thank you for sharing your knowledge to us.. god bless..
@TechWithTim
@TechWithTim Год назад
No problem! Glad you liked it
@rayne6871
@rayne6871 Год назад
Hey Tim, loved the video! Is there any way to add the curses module into this? I've been stuck on it for quite some time
@dyndarkxy8294
@dyndarkxy8294 Год назад
thank u very much this helped :)
@alexcmad1000
@alexcmad1000 Год назад
I love you Tim from Tech with Tim
@dylanyork5407
@dylanyork5407 Год назад
I've learned what I know about python from you, so thank you for that. Is it possible you could do a tutorial for an rpg style text based adventure game in python?
@sanumpzha
@sanumpzha Год назад
Nice video.👍
@MarElNij
@MarElNij Год назад
Can you make a video about how to 'upgrade' this program? Mabye by making a function to show which color is correct, incorrect or not used. Like the real game....
@fichtensaft5149
@fichtensaft5149 Год назад
You’re starting to look like Walter White Keep it up, it’s amazing Now let’s watch the video
@TechWithTim
@TechWithTim Год назад
Lmao
@odex_cod1030
@odex_cod1030 Год назад
Bro's the one who knocks
@manjultripathi8309
@manjultripathi8309 Год назад
Thanks
@ramganeshwaranm2535
@ramganeshwaranm2535 Год назад
very useful
@landonhutchinson2697
@landonhutchinson2697 5 месяцев назад
I would like to add levels to this and each time the length increases. What would be the best way to do that? Make modules?
@felanfelani9117
@felanfelani9117 Год назад
Hi, I think it wasn't required to use zip at line 49. Instead, it could have been done with a simple for loop.
@OnixEdge
@OnixEdge 11 месяцев назад
I couldn't find the code for this in your github. I'm struggling with functionality and would like to see the source code to compare.
@andrewtsegaye7330
@andrewtsegaye7330 Год назад
Is there anyone that competes with you with python? For me, you're the only one on this planet!
@ChupoCro
@ChupoCro Год назад
Are you by "competes" referring to "the ability to explain Python in an understandable and comprehensive way" or to "the ability to write very complicated Pyhon code not everyone could write"?
@andrewtsegaye7330
@andrewtsegaye7330 Год назад
@@ChupoCro Tim is python master! I'm sure that he come back with mind-blowing AI apps like chat-GPT
@ChupoCro
@ChupoCro Год назад
​@@andrewtsegaye7330 ​ I didn't say he isn't. But how could such a claim be based on watching the tutorials targeting beginners? For example, how could you tell Einstein is a top scientist afer watching him giving lectures to elementary school students? The other thing I implied is wether you examined some *really* complicated program code. You may take a look at Laplace Transform routines, understanding FFT algorithm, removing echo from sound routines, combining of accelerometer and gyroscope readings in PID loops used in quadcopters (take a look at Betaflight firmware) and similar. Of course, I am talking about programming all these from scratch and optimising the code for special purposes, not simply using some libraries. Or you may take a look at *capture the flag* problems involving Python.
@andrewtsegaye7330
@andrewtsegaye7330 Год назад
@@ChupoCro I have worked with him for years nowadays.
@Milkamoki
@Milkamoki 10 месяцев назад
Great tutorial!!! I'm just wondering if there is a way to split the users guesses with the space separator AND if there isn't any space, split by spelling. I've found something like ◽guess = [*guess] ◽but I can't find a way how to make it work with .split(" ")
@andreazevedodesign
@andreazevedodesign Год назад
Hello. Could you make an extension for inkscape, a simple one just for learning?
@TheM9s
@TheM9s Год назад
So if you enter any incorrect format answer , EG OOOO, or O O OO, it infinitely loops, how can this be solved?
@erfanali3441
@erfanali3441 Год назад
hey guys, someone can help me? i wrote this game with Tim step by step but mine is not running properly it just ask me to enter colors and then says that you must enter 4 color. and it continues like this. can you please help me? i checked my codes and it was exactly like him.
@FURY_7_7
@FURY_7_7 Год назад
Tim what is the name of your vscode theme in this video ?
@natsukeru1151
@natsukeru1151 Год назад
In the generate_code function, I would just write code.append(random.choice(COLORS)) instead of setting the random.choice to a variable then append the variable to code Is there a reason to do it in two lines instead of one? Is it a convention or just to make it easier to explain/change later?
@Hex-Scholar
@Hex-Scholar Год назад
I used random.choices!
@Miggy97
@Miggy97 Год назад
No difference at all, just helps with readability
@user-xw5lh6rv7e
@user-xw5lh6rv7e 6 месяцев назад
I hope this message finds you well. I wanted to take a moment to express my deep gratitude for your invaluable contribution to the project. Your efforts have been instrumental in its success, and I am truly grateful for your dedication and hard work. I wanted to let you know that the project has been completed, and it wouldn't have been possible without your expertise and support. Your guidance and input throughout the process have been invaluable, and I am truly grateful for your contributions.
@yessirski7868
@yessirski7868 11 месяцев назад
I have been having some trouble with this for some reason. When I try to run it, it tells me the last line where the if __name__ == __main__ line is has an error because game( ) is not defined. any idea on how to fix this issue?
@mahmudunnabisiam
@mahmudunnabisiam Год назад
Love you video following from a long time
@nothanksjac
@nothanksjac 9 месяцев назад
did everything as shown but correct position wont show in return. Help?
@leulwebshet9750
@leulwebshet9750 Год назад
I saw this notification while watching your Greedy Algorithms Tutorial😊
@kinghumbles6173
@kinghumbles6173 Год назад
Have you made series of python from zero to hero?
@marcinzale
@marcinzale Год назад
Very good explanation
@fondbcn42
@fondbcn42 Год назад
why the last 'else' didn't raise an error ?
@sadjiajfiarei3498
@sadjiajfiarei3498 Год назад
can anyone give me a piece of advice. My code always works i tried to made this programm myself and i successfully made it but the problem is that my programm is shitty not professional at all
@infinitespace1982
@infinitespace1982 Год назад
This is like wordle
@minhamhussain2000
@minhamhussain2000 Год назад
good sir
@htune754
@htune754 Год назад
im lost...how do you actually run the code. i debugged it. nothing wrong , but it wont actually run. do i need an extension?
@Goose____
@Goose____ Год назад
you do need a python extention in vscode yes
@naturesmusic1171
@naturesmusic1171 Год назад
Got a bit confused coz I kept hearing "cutters" .. figured you were saying colors
@TechWithTim
@TechWithTim Год назад
I blame my Canadian accent
@ShrijaVadla
@ShrijaVadla 13 дней назад
44 line, it says NoneType error
@relytheone853
@relytheone853 5 месяцев назад
I wish I have more knowledge to build the next big thing.
@EmirKayaloglu
@EmirKayaloglu 8 месяцев назад
NİCE MAN
@learningonline3648
@learningonline3648 Год назад
You can simply extend this to make Wordle!
@user-pi6hl7qb4d
@user-pi6hl7qb4d 3 месяца назад
Bro is responsible for me failing college but getting a job as a Py Dev lol
@odex_cod1030
@odex_cod1030 Год назад
Bro have been watching u b4 u had a breard
@Harshadswe123
@Harshadswe123 Год назад
Make project videos with golang
@Mr.Nichols
@Mr.Nichols Год назад
Fun innovative way to torture your prisoners as a Dev in Python! "Let me go, please!" "Yeah, sure let me just program this game real quick... and......... let's play." If they don't get the answer within 10 times..... they 🤐🤐
@Simple_OG
@Simple_OG Год назад
What is the name of your vs code theme
@sheepsushis5720
@sheepsushis5720 Год назад
monokai
@pmcelraft
@pmcelraft 8 месяцев назад
Wait a minute this is false advertisement as the thumbnail has a graphical program
@princesimfukwe9158
@princesimfukwe9158 Год назад
Tim with beards kkkk
@dhruvmandala5128
@dhruvmandala5128 10 месяцев назад
for me on line 44 it says guess is undefined
@ShrijaVadla
@ShrijaVadla 13 дней назад
Same, did you solve that??
@faresmahmoud1305
@faresmahmoud1305 Год назад
Hey man, loved the video keep up the good work. but I disliked the transitions for me it was too long.
@manojitbiswas555
@manojitbiswas555 9 месяцев назад
source code?
@claudiamanta1943
@claudiamanta1943 2 месяца назад
Is this how a hacker creates a simple program to guess a password?
@mcpro7334
@mcpro7334 Год назад
Hey
@ItzAngeI
@ItzAngeI Год назад
the master of python creating the mastermind game
@maigijs
@maigijs Год назад
Little bit tweaks and it will become a word guessing game!
@ChupoCro
@ChupoCro Год назад
Should be {TRIES} *tries* instead of just {TRIES}. 50+ comments and noone noticed?
@Ursus_major37
@Ursus_major37 Год назад
Pierwszy!
@buzzard777
@buzzard777 8 месяцев назад
Nice video. Not important but for some reason I keep hearing you say "cuthers" instead of colors.
@mddawid0323
@mddawid0323 Год назад
no one prefers python IDLE
@Hex-Scholar
@Hex-Scholar Год назад
Hey Tim, Nice Project, a good warmup! For Generating the Code, we could: code = random.choices(COLORS, k= CODE_LENGTH) right ?
@SubDogWater
@SubDogWater Год назад
None of your projects ever worked for me.
@TechWithTim
@TechWithTim Год назад
What are u having issues with?
@baloney_sandwich
@baloney_sandwich 10 месяцев назад
Hold a second, this doesn’t even have a GUI, useless, good effort though
@kvelez
@kvelez 23 дня назад
import random COLORS = ['R', 'G', 'B', 'Y', 'W', 'O'] ATTEMPTS = 10 LENGTH = 4 def generate_code(): code = [] for _ in range(LENGTH): code.append(random.choice(COLORS)) return code def guess_code(): while True: guess = input('Enter your guess (e.g., R G B Y): ').upper().split() if len(guess) != LENGTH: print(f'Invalid guess. Please enter a {LENGTH}-color code.') continue for color in guess: if color not in COLORS: print(f'Invalid guess. Please use colors from {COLORS}.') break else: return guess def evaluate_guess(guess, code): color_counter = {} valid_position = 0 invalid_position = 0 for color in code: if color not in color_counter: color_counter[color] = 0 color_counter[color] += 1 # First pass: Count valid positions and decrease the counter for guess_color, real_color in zip(guess, code): if guess_color == real_color: valid_position += 1 color_counter[real_color] -= 1 # Second pass: Count invalid positions without counting already matched colors for guess_color, real_color in zip(guess, code): if guess_color != real_color and guess_color in color_counter and color_counter[guess_color] > 0: invalid_position += 1 color_counter[guess_color] -= 1 return valid_position, invalid_position def game(): print(f"You have {ATTEMPTS} attempts to guess the {LENGTH}-color code.") print('The available colors are: ', ' '.join(COLORS)) code = generate_code() for attempts in range(1, ATTEMPTS + 1): guess = guess_code() valid_position, invalid_position = evaluate_guess(guess, code) print(f'Valid position: {valid_position}. Invalid position: {invalid_position}.') if valid_position == LENGTH: print(f'You guessed the color code in {attempts} attempts!') return else: print('You ran out of attempts. The code was:', ' '.join(code)) if __name__ == '__main__': game()
@OriginalCoder.__
@OriginalCoder.__ 2 месяца назад
Hi everyone import random COLOR=['R','G','B','Y','O','W'] tries=10 code_length=4 def generate_code(): code=[] for _ in range(code_length): Color=random.choice(COLOR) code.append(Color) return code code=generate_code() print(code) for i in range(tries): correct_position=0 incorrect_position=0 user_code=input("Guess The code : ").upper() for j in range(len(user_code)): if user_code[j] not in code: pass # print("Correct Position ", correct_position,"|","Incorrect Position : ",incorrect_position) elif user_code[j] in code: # print("Yes") if user_code[j]==code[j]: correct_position+=1 # incorrect_position=0 else: incorrect_position+=1 print("Correct Position ", correct_position,"|","Incorrect Position : ",incorrect_position) if correct_position==4: print("You guessed right!! in {} tries".format(i)) break else : continue Can anybody please tell is this approach of my code correct or not?
Далее
Python As Fast as Possible - Learn Python in ~75 Minutes
1:19:41
Learn Python With This ONE Project!
55:04
Просмотров 1,6 млн
3 Python Projects I’d Put On MY Resume
14:49
Просмотров 42 тыс.
10 Python Comprehensions You SHOULD Be Using
21:35
Просмотров 110 тыс.
A Gentle Introduction to DSPy in Python Part 1
25:53
Просмотров 4,2 тыс.
These coding projects give you an unfair advantage
8:13
Python 101: Learn the 5 Must-Know Concepts
20:00
Просмотров 1 млн
I made Games with Python for 10 Years...
28:52
Просмотров 246 тыс.
I learned to code from scratch in 1 year. Here's how.
41:55
5 Useful F-String Tricks In Python
10:02
Просмотров 254 тыс.
Let's code a Python SLOT MACHINE 🎰
20:11
Просмотров 8 тыс.
Automate your job with Python
6:07
Просмотров 348 тыс.