forked from ZetechUni/python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathformat_strings.py
More file actions
21 lines (15 loc) · 842 Bytes
/
format_strings.py
File metadata and controls
21 lines (15 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# FIRST WAY
# the capitalize function will return the string with
# the first letter uppercase and the rest of the word lowercase
# Ask the user for their first and last name // it does not matter how the user types it:
# ALEX, alex, aLEX etc. --> it will be saved in the memory as Alex (Fist letter will be with uppercase)
first_name = input('What is your first name? ').capitalize()
last_name = input('What is your last name? ').capitalize()
print('Hello ' + first_name + ' ' + last_name)
# SECOND WAY
# Ask the user for their first and last name
first_name = input('What is your first name? ')
last_name = input('What is your last name? ')
# the capitalize function will return the string with
# the first letter uppercase and the rest of the word lowercase
print('Hello ' + first_name.capitalize() + ' ' + last_name.capitalize())