Skip to content

Commit 0f840ff

Browse files
committed
small tweaks
1 parent 18c7cea commit 0f840ff

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

basics/answers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ isn't exactly like mine but it works just fine it's ok, and you can
159159
3. In the code below, `palindrome_input[::-1]` is the string `palindrome_input` reversed.
160160
For example, if `palindrome_input` is `"hello"`, then `palindrome_input[::-1]` is `"olleh"`.
161161
```python
162-
palindrome_input=input("Type the number to check:")
162+
palindrome_input = input("Enter a string: ")
163163
if palindrome_input == palindrome_input[::-1]:
164164
print("This string is a palindrome")
165165
else:
@@ -326,10 +326,10 @@ isn't exactly like mine but it works just fine it's ok, and you can
326326
6. ```python
327327
row_count=int(input("Type the number of rows needed:"))
328328
329-
for line_number in range(1, row_count + 1):
330-
for number in range(line_number, row_count+1):
331-
print(number, end=' ')
332-
print()
329+
for line_number in range(1, row_count+1):
330+
for number in range(line_number, row_count+1):
331+
print(number, end=' ')
332+
print()
333333
```
334334
Just like in the previous exercise, if the user enters 5, the first `for` loop gives the line numbers `1, 2, 3, 4, 5`.<br>
335335
For example, on line 2, we should print numbers from 2 to 5, as in `range(2, 6)`, or in general, `range(line_number, row_count+1)`.

basics/handy-stuff-strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ ValueError: could not convert string to float: 'hello'
424424
print(message, "!!!")
425425
print(message, "!!!")
426426
```
427-
3. Make a program to take the input from the user and check if it is a palindrome.<br>
427+
3. Make a program to ask a string from the user and check if it is a palindrome.<br>
428428
(Hint: A string is a palindrome if it is the same when reversed. Google how to reverse a string.)
429429

430430
The answers are [here](answers.md#handy-stuff-strings).

0 commit comments

Comments
 (0)