Professional Documents
Culture Documents
h. False=choice
2. Initialize age to 7 and display it. Re-initialize age to ‘Dinosaur’ and then display the value.
4. Display Malaysia and Argentina separated by a space, comma and a dollar sign.
5. Ask the user to input a float value and display its type
[Type here]
Tutorial 7-8
a.
a = 10
b = 20
print(a == b)
print(a != b)
b.
a = 30
b = 15
print(a <= b)
print(a >= b)
print(a>b)
print(a<b)
Arithmetic Operators (+,-,/,%,**)
[Type here]
Tutorial 7-8
a=4
b=3
print(+a)
print(-b)
print(a + b)
print(a - b)
print(a * b)
print(a / b)
[Type here]
Tutorial 7-8
x=5
y = 20
print(x > 10 or y < 8)
print(x > 10 or y > 8)
print(x < 10 or y > 8)
x=5
y = 20
print(x > 10 and y < 8)
print(x > 10 and y > 8)
print(x < 10 and y > 8)
x=5
y = 20
print(not x > 10 )
print(not x < 10)
print(not y > 8)
print(not y < 8)
Data Types (set,list,numbers,tuples)
print(len(str))
print(len(str) == 12)
print(len(str) != 12)
my_string = 'Hello'
print(my_string)
my_string = "Hello"
print(my_string)
[Type here]
Tutorial 7-8
my_string = '''Hello'''
print(my_string)
first_tuple = (3, 5, 7, 9)
print(first_tuple)
print(type(sample_dict))
print(sample_dict)
[Type here]