Skip to content

Commit

Permalink
Day 2 (Reverse + Palindrome) - Python (#26)
Browse files Browse the repository at this point in the history
* Create Reverse.py

* Create Palindrome.py

* Update README.md
  • Loading branch information
ashwek authored and MadhavBahl committed Dec 21, 2018
1 parent a47223e commit 019120b
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Day2/Python/Palindrome.py
@@ -0,0 +1,13 @@
'''
* @author: ashwek
* @date: 21/12/2018
'''

Str = input("Enter a string : ")

print(Str, "is", end=" ")

if( Str != Str[::-1] ):
print("Not", end=" ")

print("Palindrome")
8 changes: 8 additions & 0 deletions Day2/Python/Reverse.py
@@ -0,0 +1,8 @@
'''
* @author: ashwek
* @date: 21/12/2018
'''

Str = input("Enter a string : ")

print("Reverse of", Str, "=", Str[::-1])
36 changes: 36 additions & 0 deletions Day2/README.md
Expand Up @@ -219,6 +219,22 @@ public class Reverse {

```

## Python Implementation

### [Solution 1](./Python/Reverse.py)

```python
'''
* @author: ashwek
* @date: 21/12/2018
'''

Str = input("Enter a string : ")

print("Reverse of", Str, "=", Str[::-1])
```


<hr />

## Part B -- Palindrome Check
Expand Down Expand Up @@ -383,3 +399,23 @@ public class Palindrome2 {
}
}
```

## Python Implementation

### [Solution 1](./Python/Palindrome.py)

```python
'''
* @author: ashwek
* @date: 21/12/2018
'''

Str = input("Enter a string : ")

print(Str, "is", end=" ")

if( Str != Str[::-1] ):
print("Not", end=" ")

print("Palindrome")
```

0 comments on commit 019120b

Please sign in to comment.