Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add '\r\033[K' to delete the input string befor print the result in a…
…pp.py
  • Loading branch information
Khrisefzm committed Jan 4, 2024
commit 0c59afb76b21ea9231ec5d12662c28dc7d494dd5
13 changes: 8 additions & 5 deletions exercises/002-sum_of_three_numbers/app.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Sum all three input numbers and print on the console the result
first_number = int(input("First input"))
second_number = int(input("Second input"))
third_number = int(input("Third input"))
# print here the sum of three inputs
first_number = int(input("First input: "))
second_number = int(input("Second input: "))
third_number = int(input("Third input: "))

# Move the cursor to the beginning of the line and clear the line
print('\r\033[K', end='')

print(first_number+second_number)
# print here the sum of three inputs
print(first_number)