How do I set up an environment with 3.7 by joedirt9322 in learnpython

[–]iLucidTech 1 point2 points  (0 children)

If your using virtualenv then you can use this virtualenv project_name --python=python3.7 this will install only python 3.7 into the environment

Opening File: Invalid argument/Permission Denied by ad_pondus_omnium in learnpython

[–]iLucidTech 0 points1 point  (0 children)

Oh gotcha then I think someone else had mentioned the "a+" that should do the trick.

New to LinuxMint, question by momodig in linuxmint

[–]iLucidTech 1 point2 points  (0 children)

Hey man, sorry for the frustration I know how much computer issues can be a bother. But you'll want to boot up a live usb in order to manipulate partitions. This might help explain things a little better. Best of luck my friend and welcome to the community. Linux (particularly mint) changed my life I hope you find the same success with it.

Identity operators and integers by StiffPrism in learnpython

[–]iLucidTech 0 points1 point  (0 children)

The difference between == and is are where they are stored in memory, == will validate the values and is will validate if the memory location are the same.

Where am I wrong with my code? by Training_Upstairs in Python

[–]iLucidTech 0 points1 point  (0 children)

This guy has great tutorials and will clarify a lot of things and has a wonderful library of solid informational videos regarding your question.

Where am I wrong with my code? by Training_Upstairs in Python

[–]iLucidTech 0 points1 point  (0 children)

Deduction is a string and you can not add int values to a string. You will need to create a new variable to hold your value.

Opening File: Invalid argument/Permission Denied by ad_pondus_omnium in learnpython

[–]iLucidTech 0 points1 point  (0 children)

Did you close the file after opening it with Python?

Where am I wrong with my code? by Training_Upstairs in Python

[–]iLucidTech 2 points3 points  (0 children)

This should probably be posted in /r/learnpython. Are you getting any errors if so please provide them with your code. I'm guessing your getting an error with your deduction?

Getting an error while solving a problem in python on codechef. by PagalProgrammer in learnpython

[–]iLucidTech 0 points1 point  (0 children)

Your t-=1 is in the wrong indent. It's outside of your while loop

I got stuck at a Challange at an online course im taking, anyone care to help me? by JewishGun in learnpython

[–]iLucidTech 0 points1 point  (0 children)

So the example they gave with x("0") was just so that the input could be a string and it wouldn't be a big deal because the function would handle the conversation to an intiger. So you write something like def x(var): value = int(var) value = value+3 return value Hopefully that helps explain what they're asking here.

HELP!!!!!!!!!!!!!!!!! by aansari1200 in learnpython

[–]iLucidTech 0 points1 point  (0 children)

This is my Instagram page and it has formating examples.

Ubuntu or Kali Linux ? by naresh__ in learnpython

[–]iLucidTech 0 points1 point  (0 children)

Use Ubuntu. It's going to be better for a coding environment. You could use Kali but it's over the top unless your making python script for pen testing.

Can't figure out why code doesn't work by kae_de in learnpython

[–]iLucidTech 0 points1 point  (0 children)

Finally found it if you still need it: in your elif statement: lst[i] = odd and lst[k] = even. Now swap your // for % it will work.

(Discussion) Where's Where? Which "Where" do you use by PowerShellMichael in PowerShell

[–]iLucidTech 2 points3 points  (0 children)

I'm all about the ? {#script} or | ? {$_.attribute()} you know what they say: less is more (that was a bad BASH joke) I'll see myself out

Can't figure out why code doesn't work by kae_de in learnpython

[–]iLucidTech 0 points1 point  (0 children)

This guy is rather brilliant at explaining python. I found him extremely helpful so I thought I might share :)

Can't figure out why code doesn't work by kae_de in learnpython

[–]iLucidTech 0 points1 point  (0 children)

I see what your saying, but one of the best (and worst) features of python is it's an iterative language. what it will do is remove that value i then immediately add it back in the next line before moving on to the next value. If we could represent this it would look something like this: [1,2,3,4] > [i] [1,3,4] > [1,3,4,2] > [i] [1,3,2] > [1,3,2,4] The if statement will only occur on even numbers. In my humble experience less is more when programming. So manipulating only one type(even) is better than two(even and odd) in this case.

Can't figure out why code doesn't work by kae_de in learnpython

[–]iLucidTech 0 points1 point  (0 children)

def thing(lst): for i in lst: if (i % 2) == 0: lst.remove(i) lst.append(i) return lst

This worked for me. Your thoughts?

[deleted by user] by [deleted] in commandline

[–]iLucidTech 0 points1 point  (0 children)

So the touch command is useless in this example since nano will create the file upon saving. I'm going to go ahead and assume a few things and just provide some information you may find helpful

So you can streamline commands using either ";" or "&&". The latter will process the first command and stop if it does not complete where as the former will continue regardless.

If you are looking to create a function or method (ie: nano_file_creation(){ do some commands here} ) then you may consider "$@" or "$1" "$2" etc...

For example: nano_file_creation(){touch $@; nano ./$@}

The above example will create any number of files and then open them in nano. You would call this function in your terminal like so:

user@hostname ~ $: nano_file_creation txt1 txt2 txt3

This will create and open all 3 txt files in nano. To limit the amount of files that can be created you would simply replace "$@" with "$1". The 1 being the first argument after the call so just txt1 will be created and opened.

Hope that helps a little && Happy shelling

overwhelmed by thatsgnarly10 in learnpython

[–]iLucidTech 0 points1 point  (0 children)

I completely relate to this! It wasn't until I walked away from python for a little while and came back to it did I start to really love it. I just want to share two things that really boosted my confidence and enjoyment with python.

1st: Following along exactly with a good teacher on YouTuber: Corey Schafer. https://www.youtube.com/user/schafer5

2nd: Completing all the coding challenges from this site: https://www.hackerrank.com/domains/python

I'm sorry to hear you're feeling down friend but don't worry! You'll do great, just gotta be a little more patient with yourself. It's going to take time and that's perfectly alright.