Skip to content

Tag: python-3.x

How to replace characters and rename multiple files?

I have a bunch of pdf files which has the file name as follows: AuthorA_2014_ This is a good article BIsanotherAuthor_1994_ Gr8 artcle CIsFatherOfB_1994_Minor article but not bad And so on. I would like to change the name of the files to this format: AuthorA2014This is a good article BIsanotherAuthor1994Gr8 a…

Printing pattern without importing modules

Please help me print the pattern below as it is, if the input entered is 7: I figured out to find the middle element of the pattern with any input: Please help me complete the above pattern…… Thanks in advance! Answer If you use a list-of-lists to store the values, the value for any specific cell …

Changing the value of tuple inside a nested list

How do I change the second value of the first tuple in the first list by force?? Please help! Thanks in advance. Answer Tuples are immutable. You would need to replace it instead. Since lists are mutable, you would replace the first element of the first list with a new tuple having a changed second value. Thi…