00:01 Learn to code 3 unique Python projects from scratch 01:43 Project 1: Pig - A multiplayer game where players roll dice and accumulate scores. 05:20 Generating a random role for a game 07:13 Checking for valid number input and breaking out of the loop 11:03 Using underscores for variable names and looping through player scores. 12:57 Checking and converting input for rolling the dice. 16:52 Implementing the logic for simulating turns and calculating scores for players. 18:30 Simulating the game progress and determining winner 21:50 Finding the maximum score and the winning player 23:41 Creating a Mad Libs generator 26:49 Using open function to read a file in Python. 28:28 Replace all instances of a given word in a string with user input. 31:52 Using sets to find unique words and creating a dictionary for word values 33:34 Using dictionary to store and access key-value pairs 37:11 Using Python to replace words in a story 39:16 Project three involves generating random math questions and timing how long it takes users to answer them. 42:38 Using eval function to dynamically calculate the answer 44:34 Showing how to use the eval function in Python to evaluate expressions. 48:08 Implementing a timer and tracking correct answers in Python. 49:48 Introducing a timer function for user input. 53:25 Coding practices and availability of code
bro you literally the best teacher of python. Ive look at other videos and they either too long or saying something that out of topic i like how you go straight to the point
Just wanted to say how awesome and easy to follow your tutorials are! I watched this and your intermediate project tutorial, and they're brilliant. Thank you!
just got back into coding and i came across your channel and i must say i love the way you teach! Thank you for being so thorough and beginner friendly :)
Just finished a python practical course and wanted to test my skills. This video was an eye opener for several of problem solving skills needed for any job, gotta say everyone have to at least try to attempt these by themselves and make improvements on the already existing block of code. Thankyou so very much!!
A tip I recently learned that might help skip a few steps around 9:00, wrap the input in the value type that you need. players = int(input("Enter the number of players(2-4):"))
Thanks for your video, the explaination is great. I started with the first project, I think it is a good example to get into coding and loops. However, I am sorry if I am wrong with this but I think the code does not work as you intend it to. If your score gets over 50, you can continue rolling as long as you like. The reason this does not show up in your testing is that 50 is a very high number and there is almost always either a 2 being rolled or the player terminating before reaching this point. When you set the max_score down to 15 you will see that the termination does not work. This makes sense as the termination happens outside the for-loop and the for-loop will let you dice as long as you dont roll a 1 or terminate yourself.
Yet another great tutorial! Digesting it all, and then will code along with you, to make sure it all sinks in. There's something about the way you teach, and explain each step, which really makes it clear. Will have to check out your course 😉 Appreciate all the work you put into your videos, and the amount of free content you provide. Excited to watch and learn more!
At 11:27, you can also write player_scores = [0] * players; And you could have made it harder to accidentally make the mistake of the extra len call with better naming: name the variable player_count rather than players. Also, you might want to extract a play_turn function that plays the entire turn and returns the score for that turn.
That was great Tim, many thanks. I've watched a few Python tutorials already, but I still managed to pick up a few valuable tips. Python continues to surprise me with how simply and efficiently it's possible to write a normally 'code-consuming' process in just a couple of steps. One great tip was player_scores = [0 for _ in range(players)] I didn't know that a for loop was allowed to be used to build a list in that way. Thanks again for your help, expertise and generosity.
also theres a little bypass in the pig project, if you type no for the number of players then type a number that should be invalid it will count it as valid, to fix this just put "from asyncore import loop" in the start of the code and put "if players > 4:" after the "print("Must be between 2 - 4 players.")" and then after the "if players > 4:" put "print("Invalid, must be below or equal to 4")" then below this put "loop" , sorry if i made this confusing but thought i would just add that.
Another great tutorial. Programming that Pig game was fun. I needed to practice my Classes so I created a class for each player. I even took the pig a step further and created a Hog variant and ask the user which one they want to play.
These were super fun! A great start to building a small beginner portfolio (mostly for memories since ik jobs will not care about this im sure lol) and just getting used to python. Super fun!
I love coding Python especially that I am an intermediate Python coding skill. I would love to follow some tutorial and projects in Python with you! Oh yeah, I already liked your video. Thank you so much for teaching me something new today, I appreciate it!
heres a calculator # Function to add two numbers def add(x, y): return x + y # Function to subtract two numbers def subtract(x, y): return x - y # Function to multiply two numbers def multiply(x, y): return x * y # Function to divide two numbers def divide(x, y): if y == 0: return "Cannot divide by zero!" else: return x / y # Main program while True: print("Select operation:") print("1. Add") print("2. Subtract") print("3. Multiply") print("4. Divide") print("5. Exit") choice = input("Enter choice (1/2/3/4/5): ") # Check if choice is one of the four options if choice in ('1', '2', '3', '4'): num1 = float(input("Enter first number: ")) num2 = float(input("Enter second number: ")) if choice == '1': print(num1, "+", num2, "=", add(num1, num2)) elif choice == '2': print(num1, "-", num2, "=", subtract(num1, num2)) elif choice == '3': print(num1, "*", num2, "=", multiply(num1, num2)) elif choice == '4': print(num1, "/", num2, "=", divide(num1, num2)) elif choice == '5': print("Exiting the calculator. Goodbye!") break else: print("Invalid Input")
PIG: roll dice (1-6) if anyth other than 1, then add to score if 1, then game over the user has the choice to continue the game or to quit after every turn
Real learning is if students give you a task they've seen before, and how actual skilled expirienced teacher handles with it LIVE(!), not task prepared by himself, explaining all his thoughts at every step
@@TechWithTim just a thought. It would be nice to see something on - i don't know - 3 or 4 different levels? Something like an RPS Character generator, first in a very simple, beginner level, like add a name, age, race, some basic stats. Then in a next video or just next part add some more complex functions, like saving/loading/deleting a character, selecting some traits than can affect the basic stats, and on a "higher" level some more (idk tbh im way too beginner to come up with something reasonable). It's just one iteration, but the basic idea is to have the same project and work it out as you progress with python. - Btw thank you very much for the video. I was struggling with some loooong tutorials presenting all what you can do with python without context. This and the older mini project video helped a lot to have a basic understanding about what these elements do in practice.
Those projects are very great for a beginner, I did the second one my way ( using re.compile(r''), from the re module in order to get all ) , thank you very much for the ideas ! bonus , here is the fantastic output I got: In a crazy forest, there lived a carrot named Gigi. The carrot had a best friend, a huge snail who loved wearing a green hat. One day, a lovelly dragon appeared, carrying a smart home. "Look at this home!" said Gigi, "It's so dumb!" From that day on, the carrot and the snail went on many adventures, always looking for the next happy fish to add to their collection.
Nice. Here's mine: As I traveled through the tall forest, I stumbled upon a hidden house filled with fishes of every color. The air was sweet with the scent of tulip and the sound of guitar filled the air. I followed the path to a tall castle, where I met a wise mafia who offered me a cup of coffee. We sat on the chair and talked about the 2nd world war that had shaped the kingdom. The mafia told me about the legendary cyclops that roamed the land, and I couldn't help but feel a sense of anger. As the sun began to set, the mafia led me to a secret venice where we watched the tornado together. It was a truly tall experience and one that I would always treasure. As I left the castle, I encountered a group of fishes who were on a quest to find the legendary house. They invited me to join them on their journey, and we set off across the plains together. We encountered many challenges along the way, but with the help of my new friends, we were able to overcome them and reach our destination. When we finally found the house, we were amazed by its tall beauty and felt a sense of anger at having accomplished our goal.
Hey time in 32:55 i saw a way of removing duplicates and keeping the order without the use of sets and i did this unique_words = list(dict.fromkeys(words).keys()) print(unique_words) i created a new list called "unique_words" and changed that into a dictionary and obvs a dictionary has only one unique key value so it removes the duplicates and i retrieved the keys using the key methodes then i changed back to a list
The Programming Expert videos are like these tutorials on steroids!!!! It took me a long time to bite bullet but its well worth the price ( caught a sweet deal and bought the entire package) !
For the third project, he forgot to include the division problem back into the operators, so I expanded on the "generate_problem()" function to work for division too. I hope what I made here works. I know it is a little lengthy: OPERATORS = ["+", "-", "*", "/"] def generate_problem(): while True: # Repeat problem generation until a valid problem is generated left = random.randint(MIN_OPERAND, MAX_OPERAND) right = random.randint(MIN_OPERAND, MAX_OPERAND) operator = random.choice(OPERATORS) # Handle division to ensure integer results and valid answer range if operator == "/": # Ensure right is not 1 and left is a multiple of right, so the answer is an integer if right == 1: continue # Skip division by 1 for more meaningful questions left = left * right # Ensure integer division answer = left // right else: # For addition, subtraction, multiplication, calculate normally expr = str(left) + " " + operator + " " + str(right) answer = eval(expr) # Ensure the answer is within the valid range if MIN_OPERAND
This is a great content, will you be able to show a mini project from start to end. Something like how you get the data, how you code and how you create API and how you deploy. Thanks
Great video! Your explanation of Python is really helpful. Can you please make a video on how to send a single message to a group of people at once using Python? Thanks in advance for your amazing content
I'm a python n00b! not afraid to admit it :p I have some good bash scripting experience, and some JS / php, and am loving python so much! thx for this cool video. i really like your teaching style!
Hi Tim, I want to ask something. I'm a bit new to software. What I was wondering is, we made a game with python in project-1. So, can we use these codes on a mobile application or a game website? Or is it necessary to use a language other than python for these? (By the way, can you code such a small game for mobile? I'm very curious how the process is with the UI and deploy processes.)
Hi Tim, I just wanted to say that Im really starting to enjoy these mini project videos. if it isn't to much of a hassle, I believe that you should also try and continue the building games in an hour series. anyways, keep up the good work and thank you for the tutorials
Tried project 1 before watching the steps and I ended up writing a code that was more than 200 lines long then I came to see your solution and it was only 50 to 60 lines long lol. And yours was even cleaner except I added the option to play against computer to it
Hey Tim! Great video as always! Something that caught my attention though was toward the end of the pig game where you're displaying the winning player number. You use the max() function to get the high score from the array, but then you use the index() function to get the player number. Wouldn't this cause a bug when there's a tie? (Not that the program would crash but that it would display incorrect information about the winning condition.) Either way, great job again!
Hey, Great tutorials. keep up the good work. but i have found a mistake in the dice game: If i run my code the "Do you want to roll (y) ?" doesnt work and i am in an endless loop
In the first project, how does python know to give all players a turn and then proclaim a winner? When the condition of max_score < max(player_score) is met, doesn’t this break the loop and there for execute whatever block of code is next?
@ so i figured it out. The for loop still iterates over all players and the inner while loop for each turn. If player 2 for instance reaches 50 youd still need to go thru the iterations of for loop thru all players before it returns to the iutermost loop. So basicslly its built into the logic of the program
Love your tuts Tim. Quick question, is keeping track of start_of_word with -1 needed? It doesn't seem to actually be doing anything outside of itself since we are using i to get start and end of word. I tried removing it and it still seems to work but maybe I missed something? thx
Bro, if we do it again again means The current score will add to players score if the players will completed the game means the players score will store the value of the previous game why the game is starting again it doesn't ask any question " how many players want play" And also why the players score will store the new value once user finished the game ?
Im a bit confused on the first project pig. From what i understand the objective of the game is for the player to get the highest possible score past 50 but when the dude was using the code he would press y and then press n for some reason? isn't the purpose of the game is to keep pressing y to increase your number then if you get 1 then your turn ends? if anyone can explain this i would appreciate it thanks
I guess: use player_idx as an index to get a name, ex player 1 would be index 1 that would mean the second name in a list, so varable = ["no player",Jon,Bob,Ragnar] player 1 Jon, Im a noob so i guess someone could type a better solution, but this is my estimat of how it would work in a way.
Rather than using eval could you also use an if statement or some other function and then just do left operator right to get ans? Eval opens up some vulnerabilities but i suppose for a project like this it's fine. Great video though
On the Pig one, when it runs it just keeps asking Would you like to roll?, over and over again until you type something other than y, then it displays the score and moves to the next player. In your video it asks once and then displays your score each time. I’ve looked through and I’m not sure what I’ve done wrong, how can I fix it?
hey Tim! I came across your channel and I have been enjoying it so far. I came across one problem that I do not know how to solve. In the second project when I try to open the story.txt file it gives me FileNotFoundError: [Errno 2] No such file or directory: 'story.txt' although I followed your instructions word by word. how can I solve this problem?
Tim, thank you for this. Just finished the first project. Why all the extra work for the roll function, though? I don't understand your thinking making min and max variables.
When I made the pig game I only used one while loop and implemented a series of if-else statements. Out of curiosity which is the better coding practice?
Hello Tim , ur advice plz what you encourage me to copy the code when I watch the video or watch a part of it and try to make the same project . Or watch the full video and Try to make the same project and when I suffer alot I rewatch it
Hey TimWithTech ive wathec a coupple of viedos and id love to learn more about webdevelopment using django in python. love all ur vids, greet explainations!
If I want to add countdown timer for 10 questions Then how can I do that. Example I want to finish quiz in 20 seconds or else timed out then how to do please help me
im very new to python and have been playing a game that makes you code a drone to farm some farm land. in this game i have a main code window and i can also open up more code windows. so i create my functions in the other windows and then call them in the main code window. would this be the same in real python or should i define all functions in the same window i right my normal code in?
I tried the first project,I completely stick that code only , but I got maximum score of 73 as output, the maximum score is 50 only why it comes like that?
I appreciate the crash course. I am more familiar with running and testing code so please forgive me for being a noob. I literally go tripped up on step 1 project 1. When you import the random module how do you get this into your python ide? I am using vs and I checked the extention hub but it was not clear what I should install if this is even the correct place to install random from. Please lend some advice. Thanks!
Great tutorial thanks. Just one question if we wanted to make the curent_score zero and not store the score from the previous turn when we role 1 after few turns what can we change?
yes, but for the last program he congratulate you when you have done mistakes. There should be time penalties or something like that or telling you that you finished in Time and made 2 mistakes. 🙂
To learn programming and Python - check out Datacamp!
💻 Learn Python - datacamp.pxf.io/EKrXdQ
💻 Learn Programming - datacamp.pxf.io/ba4z9b
00:01 Learn to code 3 unique Python projects from scratch
01:43 Project 1: Pig - A multiplayer game where players roll dice and accumulate scores.
05:20 Generating a random role for a game
07:13 Checking for valid number input and breaking out of the loop
11:03 Using underscores for variable names and looping through player scores.
12:57 Checking and converting input for rolling the dice.
16:52 Implementing the logic for simulating turns and calculating scores for players.
18:30 Simulating the game progress and determining winner
21:50 Finding the maximum score and the winning player
23:41 Creating a Mad Libs generator
26:49 Using open function to read a file in Python.
28:28 Replace all instances of a given word in a string with user input.
31:52 Using sets to find unique words and creating a dictionary for word values
33:34 Using dictionary to store and access key-value pairs
37:11 Using Python to replace words in a story
39:16 Project three involves generating random math questions and timing how long it takes users to answer them.
42:38 Using eval function to dynamically calculate the answer
44:34 Showing how to use the eval function in Python to evaluate expressions.
48:08 Implementing a timer and tracking correct answers in Python.
49:48 Introducing a timer function for user input.
53:25 Coding practices and availability of code
I just got a job as a python instructor in high school because of your videos, didn't know any python beforehand!
thank you so much
Congrats. Hows the job going now that you are 10 months in? Was there any specific videos you watched?
bro you literally the best teacher of python. Ive look at other videos and they either too long or saying something that out of topic i like how you go straight to the point
Just wanted to say how awesome and easy to follow your tutorials are! I watched this and your intermediate project tutorial, and they're brilliant. Thank you!
just got back into coding and i came across your channel and i must say i love the way you teach! Thank you for being so thorough and beginner friendly :)
The three essential elements for coding success: pizza, coffee, and a solid collection of Stack Overflow bookmarks!😂
And ChatGPT 4.0 for when lazy/hungover
I had just completed all 3 projects. Thanks for this great practical tutorial.
Just finished a python practical course and wanted to test my skills. This video was an eye opener for several of problem solving skills needed for any job, gotta say everyone have to at least try to attempt these by themselves and make improvements on the already existing block of code.
Thankyou so very much!!
You mentioned a practical course.... PLEASE! do you know where i can also sign up for that.
A tip I recently learned that might help skip a few steps around 9:00, wrap the input in the value type that you need.
players = int(input("Enter the number of players(2-4):"))
Explaining every steps makes things easier to understand. Thank you Tim!
Thanks for your video, the explaination is great. I started with the first project, I think it is a good example to get into coding and loops.
However, I am sorry if I am wrong with this but I think the code does not work as you intend it to.
If your score gets over 50, you can continue rolling as long as you like.
The reason this does not show up in your testing is that 50 is a very high number and there is almost always either a 2 being rolled or the player terminating before reaching this point.
When you set the max_score down to 15 you will see that the termination does not work. This makes sense as the termination happens outside the for-loop and the for-loop will let you dice as long as you dont roll a 1 or terminate yourself.
I now adjusted the code, you need another if statement for exiting when score > 50
@@pitschiiiii what and where do I need to put it to stop it when the max score is reached ?
For anyone having an issue with "value = roll()" try: value = roll(min_value=(), max_value=())
Yet another great tutorial! Digesting it all, and then will code along with you, to make sure it all sinks in.
There's something about the way you teach, and explain each step, which really makes it clear. Will have to check out your course 😉
Appreciate all the work you put into your videos, and the amount of free content you provide. Excited to watch and learn more!
At 11:27, you can also write player_scores = [0] * players;
And you could have made it harder to accidentally make the mistake of the extra len call with better naming: name the variable player_count rather than players.
Also, you might want to extract a play_turn function that plays the entire turn and returns the score for that turn.
that's exactly what i did i made 3 functions a roll function and a func that get the turn of the player and a fucntion that get the valid player count
That was great Tim, many thanks. I've watched a few Python tutorials already, but I still managed to pick up a few valuable tips. Python continues to surprise me with how simply and efficiently it's possible to write a normally 'code-consuming' process in just a couple of steps. One great tip was
player_scores = [0 for _ in range(players)]
I didn't know that a for loop was allowed to be used to build a list in that way.
Thanks again for your help, expertise and generosity.
So I started coding using a AI as a helper and apparently you can just declare player_scores = [0] * players
also theres a little bypass in the pig project, if you type no for the number of players then type a number that should be invalid it will count it as valid, to fix this just put "from asyncore import loop" in the start of the code and put "if players > 4:" after the "print("Must be between 2 - 4 players.")" and then after the "if players > 4:" put "print("Invalid, must be below or equal to 4")" then below this put "loop" , sorry if i made this confusing but thought i would just add that.
Another great tutorial. Programming that Pig game was fun. I needed to practice my Classes so I created a class for each player. I even took the pig a step further and created a Hog variant and ask the user which one they want to play.
How did you make the classes?
a hog variant?
@@Jay-pe4gxhog is variant of pig
@@josecintron85 how does it work
Yea bro im curious lol, did you add rules or somwthing 😂@josecintron85
These were super fun! A great start to building a small beginner portfolio (mostly for memories since ik jobs will not care about this im sure lol) and just getting used to python. Super fun!
I love coding Python especially that I am an intermediate Python coding skill. I would love to follow some tutorial and projects in Python with you! Oh yeah, I already liked your video. Thank you so much for teaching me something new today, I appreciate it!
heres a calculator
# Function to add two numbers
def add(x, y):
return x + y
# Function to subtract two numbers
def subtract(x, y):
return x - y
# Function to multiply two numbers
def multiply(x, y):
return x * y
# Function to divide two numbers
def divide(x, y):
if y == 0:
return "Cannot divide by zero!"
else:
return x / y
# Main program
while True:
print("Select operation:")
print("1. Add")
print("2. Subtract")
print("3. Multiply")
print("4. Divide")
print("5. Exit")
choice = input("Enter choice (1/2/3/4/5): ")
# Check if choice is one of the four options
if choice in ('1', '2', '3', '4'):
num1 = float(input("Enter first number: "))
num2 = float(input("Enter second number: "))
if choice == '1':
print(num1, "+", num2, "=", add(num1, num2))
elif choice == '2':
print(num1, "-", num2, "=", subtract(num1, num2))
elif choice == '3':
print(num1, "*", num2, "=", multiply(num1, num2))
elif choice == '4':
print(num1, "/", num2, "=", divide(num1, num2))
elif choice == '5':
print("Exiting the calculator. Goodbye!")
break
else:
print("Invalid Input")
PIG:
roll dice (1-6)
if anyth other than 1, then add to score
if 1, then game over
the user has the choice to continue the game or to quit after every turn
Use the F-String it is better than the plus operator.
Real learning is
if students give you a task they've seen before,
and how actual skilled expirienced teacher handles with it LIVE(!),
not task prepared by himself, explaining all his thoughts at every step
Fair enough, what task would u like me to do?
@@TechWithTim just a thought. It would be nice to see something on - i don't know - 3 or 4 different levels? Something like an RPS Character generator, first in a very simple, beginner level, like add a name, age, race, some basic stats. Then in a next video or just next part add some more complex functions, like saving/loading/deleting a character, selecting some traits than can affect the basic stats, and on a "higher" level some more (idk tbh im way too beginner to come up with something reasonable). It's just one iteration, but the basic idea is to have the same project and work it out as you progress with python. - Btw thank you very much for the video. I was struggling with some loooong tutorials presenting all what you can do with python without context. This and the older mini project video helped a lot to have a basic understanding about what these elements do in practice.
It works well enough, even if your idea is solid you sound jealous :P
Those projects are very great for a beginner, I did the second one my way ( using re.compile(r''), from the re module in order to get all ) , thank you very much for the ideas !
bonus , here is the fantastic output I got:
In a crazy forest, there lived a carrot named Gigi.
The carrot had a best friend, a huge snail who loved wearing a green hat.
One day, a lovelly dragon appeared, carrying a smart home.
"Look at this home!" said Gigi, "It's so dumb!"
From that day on, the carrot and the snail went on many adventures,
always looking for the next happy fish to add to their collection.
Nice. Here's mine: As I traveled through the tall forest, I stumbled upon a hidden house filled with fishes of every color.
The air was sweet with the scent of tulip and the sound of guitar filled the air.
I followed the path to a tall castle, where I met a wise mafia who offered me a cup of coffee.
We sat on the chair and talked about the 2nd world war that had shaped the kingdom.
The mafia told me about the legendary cyclops that roamed the land, and I couldn't help but feel a sense of anger.
As the sun began to set, the mafia led me to a secret venice where we watched the tornado together.
It was a truly tall experience and one that I would always treasure.
As I left the castle, I encountered a group of fishes who were on a quest to find the legendary house.
They invited me to join them on their journey, and we set off across the plains together.
We encountered many challenges along the way, but with the help of my new friends, we were able to overcome them and reach our destination.
When we finally found the house, we were amazed by its tall beauty and felt a sense of anger at having accomplished our goal.
I had a lot of fun building all three projects
Hey time in 32:55 i saw a way of removing duplicates and keeping the order without the use of sets and i did this
unique_words = list(dict.fromkeys(words).keys())
print(unique_words)
i created a new list called "unique_words" and changed that into a dictionary and obvs a dictionary has only one unique key value so it removes the duplicates and i retrieved the keys using the key methodes then i changed back to a list
A clear and easy-to-follow tutorial. Exactly what I was looking for. Thank you so much for your videos
I really liked your 3rd project Tim. Thanks.
The Programming Expert videos are like these tutorials on steroids!!!! It took me a long time to bite bullet but its well worth the price ( caught a sweet deal and bought the entire package) !
So glad you’re enjoying it!
Your tutorial was really useful for me...thanks a million...👍
and I hope you make much more tutorials like this in different levels of difficulty...👌
For the third project, he forgot to include the division problem back into the operators, so I expanded on the "generate_problem()" function to work for division too. I hope what I made here works. I know it is a little lengthy:
OPERATORS = ["+", "-", "*", "/"]
def generate_problem():
while True: # Repeat problem generation until a valid problem is generated
left = random.randint(MIN_OPERAND, MAX_OPERAND)
right = random.randint(MIN_OPERAND, MAX_OPERAND)
operator = random.choice(OPERATORS)
# Handle division to ensure integer results and valid answer range
if operator == "/":
# Ensure right is not 1 and left is a multiple of right, so the answer is an integer
if right == 1:
continue # Skip division by 1 for more meaningful questions
left = left * right # Ensure integer division
answer = left // right
else:
# For addition, subtraction, multiplication, calculate normally
expr = str(left) + " " + operator + " " + str(right)
answer = eval(expr)
# Ensure the answer is within the valid range
if MIN_OPERAND
New here. I find this content absorbable and enjoyable. I like the direct approach to learn some basics.
bro, you are the best. Please do more of beginners projects. Thanks.
thanks for making this videos !! do more beginner and intermediate projects whenever you have the chance
This is a great content, will you be able to show a mini project from start to end. Something like how you get the data, how you code and how you create API and how you deploy. Thanks
Some beautiful mini projects to get the vibe and gist of how one needs to think to code.
print("Thanks Tim!")
Your time for the maths game was 16 seconds!! Well done, mine was 42 seconds...
Great video! Your explanation of Python is really helpful. Can you please make a video on how to send a single message to a group of people at once using Python? Thanks in advance for your amazing content
Awesome fun I totally enjoy and am encouraged.
Great Tutorial!!!
It looks so easy to code when watching someone but without help im happy to write hello world without error
I'm a python n00b! not afraid to admit it :p I have some good bash scripting experience, and some JS / php, and am loving python so much! thx for this cool video. i really like your teaching style!
Thanks for this great project. I found it helpful ❤
first python project that i made that does something! yay!!
Hi Tim, I want to ask something. I'm a bit new to software. What I was wondering is, we made a game with python in project-1. So, can we use these codes on a mobile application or a game website? Or is it necessary to use a language other than python for these? (By the way, can you code such a small game for mobile? I'm very curious how the process is with the UI and deploy processes.)
Great trio of Python classes. Thanks Tim !
Hi Tim, I just wanted to say that Im really starting to enjoy these mini project videos. if it isn't to much of a hassle, I believe that you should also try and continue the building games in an hour series. anyways, keep up the good work and thank you for the tutorials
Hello can we work on projects together ?
Actually for the madlibs generator a faster way to do it would be to use a formatted string to insert the words in
This is great. thanks Tim!
Thanks for this video! I'm a beginner.
Tried project 1 before watching the steps and I ended up writing a code that was more than 200 lines long then I came to see your solution and it was only 50 to 60 lines long lol. And yours was even cleaner except I added the option to play against computer to it
Hey Tim! Great video as always! Something that caught my attention though was toward the end of the pig game where you're displaying the winning player number. You use the max() function to get the high score from the array, but then you use the index() function to get the player number. Wouldn't this cause a bug when there's a tie? (Not that the program would crash but that it would display incorrect information about the winning condition.)
Either way, great job again!
Good point that could potentially cause a bug! Nice catcg
Hey, Great tutorials. keep up the good work. but i have found a mistake in the dice game: If i run my code the "Do you want to roll (y) ?" doesnt work and i am in an endless loop
In the first project, how does python know to give all players a turn and then proclaim a winner? When the condition of max_score < max(player_score) is met, doesn’t this break the loop and there for execute whatever block of code is next?
How do I put that into prgramming?
@ so i figured it out. The for loop still iterates over all players and the inner while loop for each turn. If player 2 for instance reaches 50 youd still need to go thru the iterations of for loop thru all players before it returns to the iutermost loop. So basicslly its built into the logic of the program
@rafdeo I did what you suggested, but I am struggling to proclaim a winner of the player to reach 50 score.
Jump and throw are verbs, not adjectives
Love your tuts Tim. Quick question, is keeping track of start_of_word with -1 needed? It doesn't seem to actually be doing anything outside of itself since we are using i to get start and end of word. I tried removing it and it still seems to work but maybe I missed something? thx
Bro, if we do it again again means
The current score will add to players score if the players will completed the game means the players score will store the value of the previous game why the game is starting again it doesn't ask any question " how many players want play"
And also why the players score will store the new value once user finished the game ?
Who dreams to become like tim
I do
Always was my dream
It's shoulders Tim today lads
if 1
Correct!
I'm having so much fun thank you :)
What a great content ❤ Ivam getting more and more captivated by these tutorials Tim. Thank you 😊
Im a bit confused on the first project pig. From what i understand the objective of the game is for the player to get the highest possible score past 50 but when the dude was using the code he would press y and then press n for some reason? isn't the purpose of the game is to keep pressing y to increase your number then if you get 1 then your turn ends? if anyone can explain this i would appreciate it thanks
My question is, how do you remember and keep a track of SOOO many variables you create while writing the code ???
you dont...its just a mental game...
it helps if you name them logically then its more similar to english when you're writing the code making it easier to comprehend
What a great content you are producing Tim! Kudos ❤
what if I want to print my players by their names?I have been struggling with this. thank you for the awesome projects
I guess: use player_idx as an index to get a name, ex player 1 would be index 1 that would mean the second name in a list, so varable = ["no player",Jon,Bob,Ragnar]
player 1 Jon, Im a noob so i guess someone could type a better solution, but this is my estimat of how it would work in a way.
hey Tim your tutorials have helped me and my buddies thank you so much
Great to hear!
Thank You sir!
I really enjoyed and learn a lot 🙏
Hi, thanks for the video. What is that program being used?
Sehr Gut! Danke 💚
Wow your a great coder thank you for this video
Rather than using eval could you also use an if statement or some other function and then just do left operator right to get ans? Eval opens up some vulnerabilities but i suppose for a project like this it's fine.
Great video though
really interesting content, many thanks!
On the Pig one, when it runs it just keeps asking Would you like to roll?, over and over again until you type something other than y, then it displays the score and moves to the next player. In your video it asks once and then displays your score each time. I’ve looked through and I’m not sure what I’ve done wrong, how can I fix it?
You are missing a break either on the while that controls if the player wants to continue rolling or in the if that controls if the player rolls a 1
hey Tim! I came across your channel and I have been enjoying it so far. I came across one problem that I do not know how to solve. In the second project when I try to open the story.txt file it gives me
FileNotFoundError: [Errno 2] No such file or directory: 'story.txt'
although I followed your instructions word by word. how can I solve this problem?
"Bear and tim live happily ever after" made me burst out of laugh....BTW thanks for ur tutorial.
Great Video Tim
Thankyou I got it at the right time
Thank you for your video!!
Tim, thank you for this. Just finished the first project. Why all the extra work for the roll function, though? I don't understand your thinking making min and max variables.
Just to make it extremely clear when reading the code!
@@TechWithTim Nice
Excellent approach 👍
Glad it was helpful!
Hello Tim, I just Wanted to know that when is the code jam happening, i am interested to join. Thanks.
Can you please update your django course with pycharm?
When I made the pig game I only used one while loop and implemented a series of if-else statements. Out of curiosity which is the better coding practice?
as a beginner, I'm cooked
Hello Tim , ur advice plz what you encourage me to copy the code when I watch the video or watch a part of it and try to make the same project . Or watch the full video and Try to make the same project and when I suffer alot I rewatch it
Hey TimWithTech ive wathec a coupple of viedos and id love to learn more about webdevelopment using django in python. love all ur vids, greet explainations!
There is one edge case in the first game if all the players has the same score then by default the player 1 will win. Thanks
If I want to add countdown timer for 10 questions Then how can I do that. Example I want to finish quiz in 20 seconds or else timed out then how to do please help me
Use stopwatch
Thank you~
Thank you
im very new to python and have been playing a game that makes you code a drone to farm some farm land. in this game i have a main code window and i can also open up more code windows. so i create my functions in the other windows and then call them in the main code window. would this be the same in real python or should i define all functions in the same window i right my normal code in?
I tried the first project,I completely stick that code only , but I got maximum score of 73 as output, the maximum score is 50 only why it comes like that?
hello Mr Tim this video is great thanks for the nice work
Where we should execute the program in anaconda or pycharm
I appreciate the crash course. I am more familiar with running and testing code so please forgive me for being a noob. I literally go tripped up on step 1 project 1. When you import the random module how do you get this into your python ide? I am using vs and I checked the extention hub but it was not clear what I should install if this is even the correct place to install random from. Please lend some advice. Thanks!
I answered my own question. I needed to specify this was a python file.
At the start of my game. It’s saying that all players have started instead of the one. Can anyone help?
Great tutorial thanks.
Just one question if we wanted to make the curent_score zero and not store the score from the previous turn when we role 1 after few turns what can we change?
yes, but for the last program he congratulate you when you have done mistakes. There should be time penalties or something like that or telling you that you finished in Time and made 2 mistakes. 🙂