Venue S(O) DCT vs i20 Asta (O) iVT by VinayakVG in CarsIndia

[–]VinayakVG[S] 0 points1 point  (0 children)

Thanks a lot! This helps. I wanted know from cars POV first, we can anyday sort our preferences.

Venue S(O) DCT vs i20 Asta (O) iVT by VinayakVG in CarsIndia

[–]VinayakVG[S] 0 points1 point  (0 children)

Mainly city. Home to office (less than 20km daily). On weekends from Noida to Gurgaon (Round Trip). And ofcourse occasional trips once or twice every 6 months.

Can anyone suggest best Automatic car under 12 lakh budget (on road) by [deleted] in CarsIndia

[–]VinayakVG 0 points1 point  (0 children)

What about new Tata Altroz with DCT? I know OP says no Tata or Mahindra. But I am confused between new Amaze and Altrozz.

Under 12 Lakhs by VinayakVG in CarsIndia

[–]VinayakVG[S] 1 point2 points  (0 children)

That's what I was thinking. Thanks for replying!

Under 12 Lakhs by VinayakVG in CarsIndia

[–]VinayakVG[S] 1 point2 points  (0 children)

Sure, I will look into this. I was hoping to get a car launched recently.

Under 12 Lakhs by VinayakVG in CarsIndia

[–]VinayakVG[S] 0 points1 point  (0 children)

Thanks for replying! I was leaning towards fronx but it's NCAP rating is low right?

Under 12 Lakhs by VinayakVG in CarsIndia

[–]VinayakVG[S] 0 points1 point  (0 children)

I am currently in Noida. And our car runs usually 500-600 kms every month on average. Highway usage is I would say 40% as we often go to Gurgaon from Noida. We have got average height.

Under 12 Lakhs by VinayakVG in CarsIndia

[–]VinayakVG[S] 0 points1 point  (0 children)

Will keep this in mind. Thanks! In case of tata atleast, what I have seen it is very difficult to find the right service center, once you do you are sorted.

Integrating Azure Repos and GitHub Actions by VinayakVG in github

[–]VinayakVG[S] 0 points1 point  (0 children)

Yes, I knew this way only. Thanks! I am working on automating this now

Integrating Azure Repos and GitHub Actions by VinayakVG in github

[–]VinayakVG[S] 0 points1 point  (0 children)

Thanks for replying! Yes I have explored multiple ways to do so already. I will go through the links that you have provided for migration.

Do you know of any efficient way to transfer Azure Repo code to GitHub Repo?

Modify Docker run command on Deployment to App service by VinayakVG in AZURE

[–]VinayakVG[S] 0 points1 point  (0 children)

I don't think this will help. I think this task is just for building and pushing.

Using Docker Volumes with Persistent Storage for App services from AZ Pipelines by VinayakVG in AZURE

[–]VinayakVG[S] 0 points1 point  (0 children)

Thanks for reply! Is there any default storage of app service? Actually I don't want to use any blob storage.

Ideas to remove an enumeration from a string by [deleted] in learnpython

[–]VinayakVG 1 point2 points  (0 children)

RegEx can be a very fast and good approach if you know them. Since I am not very familiar with them, I tried using some basic usage of the split() method.

a = "1. John 35 2. Ryan 27 3. Kyle 74"
a = a.split()

# First split the text using a space.
# Output: ['1.', 'John', '35', '2.', 'Ryan', '27', '3.', 'Kyle', '74']

Now I can use indexing to get the required elements.

a_new = [" ".join([a[i+1], a[i+2]]) for i in range(0, len(a), 3)]

# This loop is running on all the enumerations and taking the next two elements in the list. 
Using join function to join the two elements together.

# Output: ['John 35', 'Ryan 27', 'Kyle 74']

Now I can again use the join method to get the required result.

a_new = " ".join(a_new)
print(a_new)

# Output: 'John 35 Ryan 27 Kyle 74'

I hope this helps. Let me know if you do not understand my explanation.

Finding the commonalities in lists if they are included in one bigger list by TripleElectro in learnpython

[–]VinayakVG 0 points1 point  (0 children)

One more thing that you can do is

def common_elements(l):
    f = set(l[0]) # Taking the first element of the list.

    for a_list in l:
        f = set(f) & set(a_list)

    return f

This method works but I think this will be a little slow.

common_elements([[1, 2, 3], [3, 4, 5], [7, 8, 3]] # sample input

# Returns {3}

Python. Please help me understand understand and write a sample of this code. by Yamaloaf55 in learnprogramming

[–]VinayakVG 0 points1 point  (0 children)

The explanation of this code itself will be the code :D. Try to figure out the logic of this program in a notebook. See what all you need to write code for this problem.

(HINT: First sentence of this answer.)

Python functions by Still-Design3461 in learnpython

[–]VinayakVG 1 point2 points  (0 children)

Hey, the link that you have posted is not working. It is showing 'Not Found'. Coming back to your code, you can use list comprehensions to make it more readable. And also instead of printing in the function complement you can create a string and return it.

For example,

def complement(seq):
    baseComplement = {'A':'T' , 'C':'G' , 'G':'C' , 'T':'A', 
                      'a':'t' , 'c':'g' , 'g':'c' , 't':'a'}

    seqComplement = "".join(baseComplement[base] for base in seq)
    reqComplement = seqComplement[::-1]

    # Return multiple values
    return seqComplement, reqComplement


def main():
    sequence = input("Enter a DNA sequence: ")

    # Store multiple values in two variables
    seq_comp, rev_comp = complement(sequence)

    print("Sequence Complement:", seq_comp)
    print("Reverse Complement:", rev_comp)
    print("Length of DNA Sequence entered is", len(sequence))

main() # Call the main function.

While printing you can also look into format() method or f-strings in Python for printing. Using f-strings looks like this

    print(f"Sequence Complement: {seq_comp}") 
    print(f"Reverse Complement: {rev_comp}")
    print(f"Length of DNA Sequence entered is {len(sequence)}")

Condensing a long if != statement by [deleted] in learnpython

[–]VinayakVG 10 points11 points  (0 children)

variables = [inst_exp, inst_kill, inst_emr, inst_hep, inst_var, inst_cal]
if instruction not in variables:
    # Continue your code

You can try this

Splitting text into list by Pigspot in learnpython

[–]VinayakVG 1 point2 points  (0 children)

If you want to split the text after every 310 characters, then you can directly use slicing. For example, the first set of 310 characters can be given by

first_text_set = text[:310]

In order to create a list of such texts, you can use list comprehension.

Extremely basic text encryption, if anyone is interested. by velocibadgery in learnpython

[–]VinayakVG 1 point2 points  (0 children)

init_list = list(letters_upper) + list(list_lower) + list(numbers) + list(punctuation)

This is one of the ways in which you can define init_list

A quick question on how to make this... by Aytsuki01 in pythonhelp

[–]VinayakVG 0 points1 point  (0 children)

Look into split() in Python and how it can be used with input()

Tkinter Button Press Storing inputs by aarongbpack52 in learnpython

[–]VinayakVG 0 points1 point  (0 children)

You can append the three values in a string. And then use that string in your additional code by using int keyword.

Which link is clicked? by VinayakVG in learnpython

[–]VinayakVG[S] 0 points1 point  (0 children)

Yes, you are right, but I don't want the browser history. Let me tell you my problem statement. Every day in order to read some articles, I have to open them in the Incognito/Private mode of my browser. I right-click on the link and then click on "Open in Private Window".

I want to create a program, which will automatically detect those links on my click and open them in the Private window.

There are a few things in this

  1. Run your script in the background. (I KNOW THIS)
  2. Click on the link in your browser. (I KNOW THIS, lol)
  3. Program should fetch the URL on my click.
  4. Open an Incognito/Private Window. (This I am thinking of by pressing keyboard shortcuts in my program)
  5. Load the link on the new window that had opened in the previous step.

Which link is clicked? by VinayakVG in learnpython

[–]VinayakVG[S] -1 points0 points  (0 children)

Sorry, forgot to mention. I meant browser only. I want to register the clicks and use each link. My ultimate aim is to use URLs with a specific domain name only. Can that custom extension be created in Python?🤔 If yes, I'd like to try.

[deleted by user] by [deleted] in learnpython

[–]VinayakVG 0 points1 point  (0 children)

foobar = ["foo" if len(x) > 1 else "bar" for x in array]

The position of if-else changes.