Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ISA 383 Solution Manual
- #Made by Prem Rajendran
- #Guess which movie these quotes are from ;)
- #Q1
- print("I'm gonna make him an offer he can't refuse".partition('offer'))
- print('Leave the gun. Take the cannoli'.partition('gun'))
- print("It's not personal Sonny. It's strictly business".partition("It's"))
- #Q2
- print('Look how they massacred my boy'.ljust(75,'-'))
- print('Revenge is a dish that tastes best when it is cold'.center(75,'-'))
- print('Never let anyone know what you are thinking.'.rjust(75,'-'))
- #Q3
- string_variable='Welcome to Python'
- print(len(string_variable)) #1
- print(string_variable[:1]) #2
- print(string_variable[-1:]) #3
- print(string_variable[1:]) #4
- print(string_variable[4:10]) #5
- print(string_variable[2:]) #6
- print(string_variable[-4:]) #7
- print(string_variable[::2]) #8
- print(string_variable[::-1]) #9
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement