Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Computer Science Assignment
- By Mark Wu 3217
- @markwu.me
- # ---------------------------------------------------
- Task 1.1
- Answer:
- 1: "Comp"
- 2: "put"
- 3: "put"
- Code:
- '''
- InputString = input("Please input anything:")
- # InputString = "Computer Science"
- print(InputString[0:4])
- print(InputString[3:6])
- print(InputString[0:6][-3:])
- # ---------------------------------------------------
- # Task 1.2
- first_name = input("Please input the first name:")
- second_name = input("Please input the second name:")
- # first_name = 'Abdul'
- # second_name = 'Sharif'
- print(first_name + ' ' + second_name)
- print(first_name[0] + ' ' + second_name)
- print(second_name + ', ' + first_name)
- print('Mr ' + first_name[0] + ' ' + second_name)
- print('Dear Mr ' + second_name)
- print('First name:' + first_name + ', Second name:' + second_name)
- print(first_name + ' ' + second_name.upper())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement