- Write a code that shows in the Terminal: “Hello, my name is Ben”
- Ben needs to be in a variable.
- Write a code that shows in the Terminal the type of these variables:
- a=12
- b=1.5
- c=”Hello”
- d=True
- Set a=”Ben” and try to print “Hi, my name is Ben” without using the “f” before the quotation marks.
- Set a=”Ben” and b=”10″, print(a+b), you might discover something new.
Solutions
1.
a="Ben"
print(f"Hello, my name is {a})
2.
a=12
b=1.5
c="Hello"
d=True
print(type(a))
print(type(b))
print(type(c))
print(type(d)) #We'll talk about this type of data next time :p
3.
a="Ben"
print("Hi, my name is", a)
4.
As you can see the “+” between two strings functions as a concatenation operator!


Leave a comment