Python print/write

Ok so, when I print text and text1 it displays something like this: END OF TEXT HERE BEGINNING OF TEXT1 HERE I want the output to be like this for both print and write: END OF TEXT HERE BEGINNING OF TEXT1 HERE I want the output to be like this for both print and write:… Read More Python print/write

Can anyone help me find out whats wrong with my code? something isnt right but python says its fine

The code is functioning. Python says the code is executing, but it wont print anything. Ive looked around and i cant find anything that answers my question. why wont the code print the print statements? Ive only been learning python on the ocr gcse specification for about 2yrs now so im not the most advanced.… Read More Can anyone help me find out whats wrong with my code? something isnt right but python says its fine

How do I print my outputs of a for loop in one line ordered by index

Is it possible to print my outputs of a for loop in one line and ordered by index: For example: outputs:TAWSG, HUHWO, ETOHO, RHDAD, EOETI, IRCID, SIISE, NTDAA, OYE —-> THEREISNOAUTHORITYWHODECIDESWHATISAGOODIDEA >Solution : lst = [‘TAWSG’, ‘HUHWO’, ‘ETOHO’, ‘RHDAD’, ‘EOETI’, ‘IRCID’, ‘SIISE’, ‘NTDAA’, ‘OYE’] max_len = max([len(x) for x in lst ]) for i in… Read More How do I print my outputs of a for loop in one line ordered by index

When I list the integers in a list, an extra one gets added at the end [Python]

numberlist = [1, 4, 7, 5, 6, 2, 4] for i in numberlist: pos = numberlist.index(i) next = pos + 1 ordering = [i, numberlist[next]] print(ordering) This is the code I’m having problems with. When I run it, it’s supposed to print multiple lists containing 2 items: The value of i and the number right… Read More When I list the integers in a list, an extra one gets added at the end [Python]