SimeonTs

SUPyF2 Basic Exercise - 04. Double Char

Sep 24th, 2019
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. """
  2. Basic Syntax, Conditional Statements and Loops - Exercise
  3. Check your code: https://judge.softuni.bg/Contests/Compete/Index/1719#3
  4. Video: https://www.youtube.com/watch?time_continue=4&v=7sHE4HEUqi8
  5.  
  6. SUPyF2 Basic Exercise - 04. Double Char
  7.  
  8. Problem:
  9. Given a string, you have to print a string in which each character (case-sensitive) is repeated once.
  10.  
  11. Examples:
  12. Input           Output
  13. Hello World     HHeelllloo  WWoorrlldd
  14. 1234!           11223344!!
  15. """
  16.  
  17. word = input()
  18. new_word = ""
  19.  
  20. for letter in word:
  21.     new_word += letter * 2
  22.  
  23. print(new_word)
Add Comment
Please, Sign In to add comment