← 输入框|github.com|刷新
Skip to content

Implement the end keyword argument in print() #704

Closed

Description

@faze-geek

The motivation behind this issue is #665 and #687 .
Print in python is print(value(s), sep= ‘ ‘, end = ‘\n’) where end is keyword argument set to "\n" by default to take the cursor to the next line. That user should be able to control that .

I have added it as a pull request here faze-geek#2 . @certik do tell me if this is a possible addition then I'll make a pull request with tests and updated reference files here .

Use case and test on branch -

def main():
    print("a","b","c",sep = "=", end ="+")
    print("d","e","f",end ="!!" , sep = "*\n")

main()

(lp) anurag-3:lpython user$ python try.py

a=b=c+d*
e*
f!!(lp) anurag-3:lpython user$ ./src/bin/lpython try.py && ./a.out 

a=b=c+d*
e*
f!!(lp) anurag-3:lpython user$

Activity

  1. czgdp1807 commented on Jun 28, 2022

    @czgdp1807
    Collaborator

    have added it as a pull request here faze-geek#2

    You made a PR to your own fork. I think you might want to shift to https://github.com/lcompilers/lpython

  2. certik commented on Jun 28, 2022

    @certik
    Contributor

    @faze-geek yes, we should do this. Next time just send a PR against the main repository, don't worry if you are not sure. We discuss it and if it is not the right approach, then we can always close it. Your PR seems like the right approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions