Python Forum
what does x reprsent in this code ? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: what does x reprsent in this code ? (/thread-25722.html)

Pages: 1 2 3


RE: what does x reprsent in this code ? - astral_travel - Apr-11-2020

thank you both !

i'm reading it now buran...


RE: what does x reprsent in this code ? - astral_travel - Apr-18-2020

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 ?


RE: what does x reprsent in this code ? - ndc85430 - Apr-19-2020

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.


RE: what does x reprsent in this code ? - astral_travel - Apr-19-2020

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 !


RE: what does x reprsent in this code ? - ndc85430 - Apr-19-2020

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").


RE: what does x reprsent in this code ? - astral_travel - Apr-19-2020

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...


RE: what does x reprsent in this code ? - astral_travel - Apr-19-2020

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 ?


RE: what does x reprsent in this code ? - buran - Apr-19-2020

https://python-forum.io/Thread-Validating-User-Input


RE: what does x reprsent in this code ? - astral_travel - Apr-19-2020

thanks buran, i'll get into it tomorrow


RE: what does x reprsent in this code ? - astral_travel - Apr-21-2020

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.. ?