I made a completely pointless thing in python that was kinda easy to makeWatch

Announcements
#1
ARE YOU PROUD OF ME?

lmao learning python because why not, and wanted to make something using the basics before moving on to slightly more complicated stuff like lists, arrays, dictionaries etc.

EDIT: Some parts of it aren't showing up properly
Code:
```from random import randint

digit_1 = str(randint(0, 9))
digit_2 = str(randint(0, 9))
random_number = digit_1 + digit_2
guessing_1 = True
guessing_2 = False
points = 0

print("Get a score as close to 0 as possible";)

while guessing_1:
digit_1_guess = input('Guess the first digit: ';)

if digit_1_guess == digit_1:
print("You guessed the first digit correctly, try guessing the          next";)
guessing_1 = False
guessing_2 = True
else:
print('Guess again';)
points = points + 1

while guessing_2:
digit_2_guess = input('Guess the second digit: ';)

if digit_2_guess == digit_2:
print("You guessed the second digit correctly!";)
guessing_2 = False
points = str(points)

else:
print("Guess again";)
points = points + 1

print("Well done, you found the number, it is " + random_number)
print("You scored " + points + " points! Try again and get it even closer to zero!";)```
0
#2
There are a bunch of semicolons in there that I didn't put in and a big space lmao
0
1 year ago
#3
lol I remember doing this in btec level 2 ict back in the day
1
#4
Attachment 734758

Yeah if you wanna see it (for whatever reason) here is a picture of it
0
1 year ago
#5
(Original post by Bill Nye)
ARE YOU PROUD OF ME?

lmao learning python because why not, and wanted to make something using the basics before moving on to slightly more complicated stuff like lists, arrays, dictionaries etc.

EDIT: Some parts of it aren't showing up properly
Code:
```from random import randint

digit_1 = str(randint(0, 9))
digit_2 = str(randint(0, 9))
random_number = digit_1 + digit_2
guessing_1 = True
guessing_2 = False
points = 0

print("Get a score as close to 0 as possible";)

while guessing_1:
digit_1_guess = input('Guess the first digit: ';)

if digit_1_guess == digit_1:
print("You guessed the first digit correctly, try guessing the          next";)
guessing_1 = False
guessing_2 = True
else:
print('Guess again';)
points = points + 1

while guessing_2:
digit_2_guess = input('Guess the second digit: ';)

if digit_2_guess == digit_2:
print("You guessed the second digit correctly!";)
guessing_2 = False
points = str(points)

else:
print("Guess again";)
points = points + 1

print("Well done, you found the number, it is " + random_number)
print("You scored " + points + " points! Try again and get it even closer to zero!";)```
There’s a book called automate the boring stuff with python it’s online, I recommend it!
1
#6
(Original post by yellowcopter)
lol I remember doing this in btec level 2 ict back in the day
BTEC?

wtf noob you did a level 2 BTEC that means you won't go to oxbridge.

That means you dumb boi

Spoiler:
Show

0
1 year ago
#7
(Original post by yellowcopter)
lol I remember doing this in btec level 2 ict back in the day
This is a bit of a self drag since you admit to doing btec lol
0
1 year ago
#8
(Original post by Bill Nye)
BTEC?

wtf noob you did a level 2 BTEC that means you won't go to oxbridge.

That means you dumb boi

Spoiler:
Show

How will I ever live with myself

Oh wait I did A Level Computing and have no desire to go to Oxbridge nor study Comp Sci, already feel better.

There was a once upon a time I did want to do computer science tho. Then I realised being a programmer would be the most boring job in the world for me. Simply not my personal passion.

(Original post by romil332)
This is a bit of a self drag since you admit to doing btec lol
Well not really, as everyone at my secondary school did mandatory level 2 ICT. They didn't do GCSE ICT, and Computing GCSE didn't exist back then...
0
1 year ago
#9
Well done! Everyone starts somewhere!

TSR's forums have got more bugs than a bait shop, sometimes it's easier to paste code on somewhere like https://repl.it instead

Small programs like this are a good way to practice and get better, even once you've mastered the basics, otherwise you forget things that you don't do very often, so writing small programs on a regular basis is a good way to stay sharp. Actually, there's even a name for it - Code Kata - http://codekata.com/

Maybe the next step is to make a more general solution - for example, changing the program so that it could cope with 3, 4, 5 or 10 digits without writing code which is almost copy+pasted. Being able to take some existing code solution and generalise it is an important skill!
1
X

new posts
Back
to top
Latest
My Feed

Oops, nobody has postedin the last few hours.

Why not re-start the conversation?

see more

See more of what you like onThe Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

University open days

• Cardiff Metropolitan University
Sat, 19 Oct '19
• Coventry University
Sat, 19 Oct '19
• University of Birmingham
Sat, 19 Oct '19

Poll

Join the discussion

Why wouldn't you turn to teachers if you were being bullied?

They might tell my parents (16)
6.93%
They might tell the bully (25)
10.82%
I don't think they'd understand (39)
16.88%
It might lead to more bullying (80)
34.63%
There's nothing they could do (71)
30.74%