Python Day 3

How to get inputs from users

print 'What is ur first name'

firstName = raw_input()

print 'What is ur last name'

lastName = raw_input()

print 'Your name is ', firstName, lastName

// Other way
name = raw_input('What is ur name')
print 'Name is %s' name

raw_input() - prompts the user to input values to the system

No comments:

 Python Basics How to check the version of Python interpreter mac terminal

Popular in last 30 days