Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Jan 27, 2019 15:36
ill take another look at it. thanks guys, you have been really helpful :)
Jan 27, 2019 15:33
@ParitoshSingh well it should be 1 because the idea is that the cow and bull count helps the player to achieve the correct answer finally. therefore my code should focus on the user input, not the ...........ooooooooohhhhhhhhh
Jan 27, 2019 15:26
@AnttiHaapala i generate ints using the random module and then convert the whole 4-digit number to a string
Jan 27, 2019 15:25
@ChuckIvan yes. I guess thats what i tried to find an alternative for but couldnt find any. as to the the non-repetition of numbers: i am using examples from pythonpractice.org, where they didnt specify that. i didnt know how familiar people here are with that site, so i just googled for a quick explanation from a maybe more known website. (i do not know yet how protective you guys are when it comes to sharing links on here :')
Jan 27, 2019 15:19
@Chuck
Jan 27, 2019 15:13
dont i have to do that to then do further checks with the if-statements?
Jan 27, 2019 15:12
well i could figure out how to do it, it just looks clumsy as hell
Jan 27, 2019 15:10
i tried to check for duplicates in the user input after the elif bull statement, but cant for the life of me figure out how to do that
Jan 27, 2019 15:09
example: the random number is 7667, user input is 6453:
cow count would be (rightfully) 0, but bull count is 2, when it should be 1
Jan 27, 2019 15:08
heres the for loop: dpaste.com/3NKEQY1
Jan 27, 2019 15:08
alrighty then: im trying to build a cows and bulls game(for everyone not familiar: en.wikipedia.org/wiki/Bulls_and_Cows#The_numerical_version). It works fine besides on problem: i use a for loop to check whether the a digit from userguess is in the random number. then i check if i should attribute cow or bullpoints. if it should be bullpoints, this happens(this is where im unclear as to how to ask)
Jan 27, 2019 14:55
I have a question about a piece of code I'm writing to practice python, and i got stuck. i was about to post a question on the forums but realized that i dont really know what exactly i am looking for or how to formulate it in a forum appropriate way. mind if i ask it here to get some clarity? :D
Jan 27, 2019 14:53
hello everyone :)
Jan 23, 2019 00:43
yet, its always a little embarassing :(
Jan 23, 2019 00:42
yeah, sometimes its the stupidest mistakes that go unnoticed
Jan 23, 2019 00:40
thank you ^^
Jan 23, 2019 00:40
oooooooooooooooooohhhhhhh
Jan 23, 2019 00:38
{ if number % 2 == 0:
^
SyntaxError: invalid syntax]
Jan 23, 2019 00:36
the "of course, sorry" was responding to your question if i meant even, not equal ^^
Jan 23, 2019 00:33
of course, sorry
Jan 23, 2019 00:33
but i get an error message for invalid syntax on the first if statement when i run it in my console. the pointer is on the colon
Jan 23, 2019 00:32
hey, i have a really weird problem, im still at the beginner level in python and when i couldnt sleep i found an exercize page. i am writing a script to check if a given input number is equal or not: dpaste.com/3J0WAES