+ 1
Can anyone enlighten me about slicing in python and how it's used?
6 Answers
+ 2
check this video.
https://youtu.be/ajrtAuDg3yw
+ 2
No, no, it is perfectly reasonable, when you start a program, to expect that it either does stuff or tells you what it needs and not just fail. It's only that it's hard to do here. After a while you get used to it...
+ 1
And after you've done that, if you want to look at some practical applications, I'd be happy if you took a look at my examples. :-)
(If something is confusing, please ask.)
https://code.sololearn.com/c36892iW8Srd/?ref=app
https://code.sololearn.com/cJPmTf5bW1la/?ref=app
https://code.sololearn.com/cOgBIKfp377h/?ref=app
+ 1
HonFu your codes looks awesome but at the moment I'm not able to understand them much but I'll check them later for sure when I'll catch up.đ and the third code (owl matrix asserter) is showing error
+ 1
partha, the error happens because the program expects you to do a special kind of input first.
Unfortunately we have no real way here to interact with the user (except in web programming), so we can only explain in a comment, how it works.
I have changed other scripts in order that if you don't input anything, there's a default data set. Mostly I don't use inputs anymore and let people enter directly in the code instead.
About my codes: You can move through a slice in so many ways (startpoint, endpoint, direction, stepwidth) that you can do a lot of stuff with it, like move within a geometrical shape like a square or a cube.
Mostly squares get modelled using two values for a point (x and y), but with Python slices you can just write a long list of numbers and make it behave like a square or a cube - so I was having a bit of fun doing exactly that. ;-)
+ 1
oops sorry then HonFu it's my lack of knowledge đ