0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Python解説を覚え書き 4 - Input

Posted at

Getting input

name = input("Enter your name: ") age = input("Enter your age: ") print("Hello " + name + "! You are " + age)

Calc

# Python is just going to convert it into a string by default. num1 = input("Enter a number: ") num2 = input("Enter another number: ") result = float(num1) + float(num2) # int = integer, float is for decimal number.

print(result)

Mad Libs (空欄補充のゲーム)

# print("Roses are {color}")
# print("{plural noun} are blue")
# print("I love {celebrity}")

color = input("Enter a color: ") plural_noun = input("Enter a Plural Noun: ") celebrity = input("Enter a celebrity: ")

print("Roses are " + color) print(plural_noun + " are blue") print("I love " + celebrity)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?