Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Intro to Python

Input Output
What the user puts into a program Information sent out by a
program
Print Statements
Function that outputs a message

One way to communicate with the user

print “Hello world!”


Output: Hello world!

https://www.tutorialspoint.com/execute_python_online.php
Variables

Something that stores a value


variable = 5
Name of the variable cannot: print(variable)
- Have spaces
- Start with a number

Declare a variable by stating its name Output: 5


and making it equal to something
Data Types
String - sequence of characters (ex: “Hello world!”), indicated by double
quotation marks

Integer - counting number (ex: 1, 2, 3, 4, 5…)

Floating point numbers - numbers with decimals (ex: 1.0, 2.7, 5.9)

Booleans - only holds the value true or false


Activity

variableString = “Hello
print (variableString)
world!”
print (variableInt)
variableInt = 5
print (variableString)
variableFloat = 7.9
print (variableBool)
variableBool = true

You might also like