Problem Set 1¶
Problem 1.1
Consider the following sentence: “Python is the best programming language”.
Write a Python script which stores each word of that sentence into its own variable and then prints the whole sentence out using a single print statement.
Problem 1.2
Fix the errors in the following Python code, which is meant to return the sum of a
and b
. Identify each error as a syntax
, runtime
, or semantic
error:
a:=3
8 = b
b = 8
c = a plus b
print a
Problem 1.3
- Generate expressions to:
add two variables,
multiply two variables and then add a third
divide the expression from 1. by the expression from 2.
convert a temperature in Celsius to Fahrenheit.