Python understands data in the form of __, __, and _____.
Use your IDE of choice to find out what these do, noting the effect in
print len("strings!") print "strings".lower() print "strings".upper() print "strings".capitalize() print str("strings!") print type("Hello there, children.")
What’s wrong with this code?
print "The meaning of life is" + 42 # How can we fix it?
In this assignment, you’re going to create an app to calculate your GPA. The code will look something like this:
# variable = input("question?")
math = input("What's your grade in math?")
# What happens if you try this?
- [ ] How many inputs do you need?
- [ ] What kind of data do you get back from an input?
Try this to find out a type of data:
print type(input("What's your grade in math?"))
|Create a variable for each class (at your school)||☑️|
|Make each variable an
|Add up the value of each class…||☑️|
|…divide by…you know||☑️|
|Tell the user their average||☑️|