Skip to content

Introduction Part - Part 2 - Simple loops - Shall we continue? #103

@npereira89

Description

@npereira89

In this exercise, you demand to use 3 print outputs, but we can use only 2 to optimize code and bytes. It was a limitation for who is python developer with some knowledge. It's not a bug but should be a improvement. What do you think?

Your solution:


print("hi")
greeting = input("Shall we continue? ")

while greeting != 'no':
    print("hi")
    greeting = input("Shall we continue? ")
print("okay then")

My suggestion:

greeting = input("hi\nShall we continue? ")
while greeting != 'no':
    greeting = input("hi\Shall we continue? ")
print("okay then")

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