Перейти к содержанию

Hunt 3: Types

English

Text or number?

  • "3" is text. 3 is a number. They look the same when you print them, but they act differently.
  • input() always gives text.
Word Meaning
type the kind of value: text (str), whole number (int), decimal (float)
convert change the type: int("4") gives 4
print("4" * 2)
print(4 * 2)

Войти или создать аккаунт

IGCSE, A-Level & AP