SHARE
TWEET

CS-PreRelease_Task1.py

maincarry May 15th, 2016 (edited) 196 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. '''
  2. Computer Science Assignment
  3. By Mark Wu 3217
  4. @markwu.me
  5.  
  6. # ---------------------------------------------------
  7.  
  8. Task 1.1
  9.  
  10. Answer:
  11. 1: "Comp"
  12. 2: "put"
  13. 3: "put"
  14.  
  15. Code:
  16. '''
  17.  
  18. InputString = input("Please input anything:")
  19. # InputString = "Computer Science"
  20.  
  21. print(InputString[0:4])
  22. print(InputString[3:6])
  23. print(InputString[0:6][-3:])
  24.  
  25.  
  26.  
  27. # ---------------------------------------------------
  28. # Task 1.2
  29.  
  30. first_name = input("Please input the first name:")
  31. second_name = input("Please input the second name:")
  32.  
  33. # first_name = 'Abdul'
  34. # second_name = 'Sharif'
  35.  
  36. print(first_name + ' ' + second_name)
  37. print(first_name[0] + ' ' + second_name)
  38. print(second_name + ', ' + first_name)
  39. print('Mr ' + first_name[0] + ' ' + second_name)
  40. print('Dear Mr ' + second_name)
  41. print('First name:' + first_name + ', Second name:' + second_name)
  42. print(first_name + ' ' + second_name.upper())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top