my first program
This commit is contained in:
parent
48a5df1cd6
commit
da123abb9b
1 changed files with 13 additions and 4 deletions
17
hello.py
17
hello.py
|
|
@ -8,7 +8,16 @@ name = input("What is your name? ")
|
|||
print("Nice to meet you, " + name)
|
||||
|
||||
# int(input(...)) is one thing, not two. input() always hands back text,
|
||||
# even when someone types a number, and you cannot do maths with text.
|
||||
# Wrapping it in int() turns that text into a number.
|
||||
age = int(input("How old are you? "))
|
||||
print("Next year you will be", age + 1)
|
||||
# even when someone types a number, and you cannot do maths with text
|
||||
|
||||
color = input("what is your favorite color? ")
|
||||
print("My favorite color is " + color)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue