@@ -159,7 +159,7 @@ isn't exactly like mine but it works just fine it's ok, and you can
159
159
3 . In the code below, `palindrome_input[::- 1 ]` is the string `palindrome_input` reversed .
160
160
For example, if `palindrome_input` is `" hello" ` , then `palindrome_input[::- 1 ]` is `" olleh" ` .
161
161
```python
162
- palindrome_input= input (" Type the number to check: " )
162
+ palindrome_input= input (" Enter a string: " )
163
163
if palindrome_input == palindrome_input[::- 1 ]:
164
164
print (" This string is a palindrome" )
165
165
else :
@@ -326,10 +326,10 @@ isn't exactly like mine but it works just fine it's ok, and you can
326
326
6 . ```python
327
327
row_count = int (input (" Type the number of rows needed:" ))
328
328
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 ()
333
333
```
334
334
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>
335
335
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 )`.
0 commit comments