Python Forum
what does x reprsent in this code ?
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what does x reprsent in this code ?
#11
thank you both !

i'm reading it now buran...
Reply
#12
regarding sudoko, - what if i wanna build a sudoko program which has, say, 999 lines and columns - is there a way of creating the array without actually writing it 999x999 times ?
Reply
#13
Of course there is. It would be difficult to write useful programs if you couldn't do such things, wouldn't it? Do you know how to use loops? Also, note that Python has a repetition operator for lists.
Reply
#14
well i read about lists and stuff...but the website from which i learned about it was very short in its descriptions of how to do things, it touched everything a bit, in a simplistic way, but it didn't say anything about such a thing. can you elaborate on this ? i'd very much appreciate it,

even direct me to a page where they explain about such possibility...

thanks !
Reply
#15
What book are you reading? Think Python is pretty good: http://greenteapress.com/thinkpython2/html/index.html. Do note that when you learn programming, you're really learning a set of tools and it's up to you as the programmer to work out how to use them to solve whatever problem you have (e.g. the problem of "writing a Sudoku game").
Reply
#16
i'm learning from this website...

what you just sent me seem overwhelming...

but it's good actually,
seem to be written in a very friendly way...
Reply
#17
what if i have this code:

x = int(input('enter a number: '))

if x == 7:

    print('x equals 7')

else:

    print('input does not equal 7')
very simple right, but what if the user presses 'enter' or 7.7 or 'abc'...
then i get an error, so how do i replace it with some response ?
Reply
#18
https://python-forum.io/Thread-Validating-User-Input
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#19
thanks buran, i'll get into it tomorrow
Reply
#20
i'm running linux ubuntu,
on my system is installed both python 2.7 and python 3.5

is it safe to uninstall python 2.7 without disabling or damaging in any way the 3.5 version ?

for example, if i check out the PIP version, it tells me it's 20.0 something, but it also tells me it runs on python 2.7 and that this version is out of date,

the question is if i uninstall python 2 will it disable the packages running under it.. ?
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020