2018-19 Lesson 3: Strings, Integers and Float

posted Nov 9, 2018, 7:58 AM by Attila Lengyel
print("Hello World!!!")

first_name = input("What is your name?")
print("Hello", first_name, "How are you?")

first_name = "Test"
print("Hello", first_name, "How are you?")

print("I can do math!")
a = int(input("Give me a number:"))
b = int(input("Give me a second number:"))
print("The sum is", a + b)
print("The difference is", a - b)
print("The product is", a * b)
print("The quotient is", a / b)
print("a on the power of b", a ** b)

a = a / b

import math

c = float(input("Give me c:"))
d = float(input("Give me d:"))
print("The sum is", c + d)
print("The difference is", c - d)
print("The product is", c * d)
print("The quotient is", c / d)
print("a on the power of b", c ** d)
print("Square root of c", math.sqrt(c))
print("Square root of d", math.sqrt(d))