Skip to content

Day 2 Question 9 #127

Open
Open
@Jugnupapa

Description

in this program every second string is being saved and every odd string is skipped.

Solution:
change while input(): to while True: and it will be solved like below:

Why do every second line is storing in the list and all odd lines are skipped?

lst = []

while True:
x = input()
if len(x) != 0:
lst.append(x.upper())
else:
break

print(lst)
for line in lst:
print(line)

Activity

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions