Don't like ads? PRO users don't see any ads ;-)
Guest

2-2

By: Mars83 on Oct 3rd, 2011  |  syntax: Python  |  size: 0.47 KB  |  hits: 102  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #! /usr/bin/env python3.2
  2. # -*- coding: utf-8 -*-
  3.  
  4. # main.py
  5. """ Task: Exercise 2.2
  6.    Write a program that uses raw_input to prompt a user for their name and
  7.    then welcomes them.
  8.    Enter your name: Chuck
  9.    Hello Chuck
  10. """
  11. """ Additional comment: This python source code is written in python 3.x!
  12.    So 'print "abc"' -> 'print("abc")' and 'raw_input()' -> 'input()', ...
  13. """
  14.  
  15. # Includes
  16.  
  17. # Main
  18. username = input("Enter your name: ")
  19. print("Hello " + username)