Anyone Can Code.

## Tutorial 2: Quiz 2

### Question 2: What is the output of the following code?

``````
x = 17 + 37j
print(x.imag)
``````

### Question 3: What is the output of the following code?

``````
num1 = '1'
num2 = '7'
print(num1 + num2)
``````

### Question 4: Write the print statement to print out 'qprogramming' from the following list using indexes

``````
list_name = ['hello', 'welcome', 'to', 'qprogramming']
``````

### Question 5: Convert the following list to a tuple

``````
list_1 = ['convert', 'to', 'tuple']
``````

### Question 6: Add the name 'Ronaldo' to the following set

``````
footballers = {'Messi', 'Lewandowski', 'Neymar'}
``````

### Question 7: What would be the output of the following code? (Output should be typed alphabetically)

``````
set1 = {'A', 'E', 'I'}
set2= {'A', 'E', 'I', 'O', 'U'}
set1.update(set2)
print(set1)
``````

### Question 8: Write the print statement to print out the length of the following list

``````
list2 = ['length', 'item2', '3']
``````

### Question 9: What would be the output of the following code?

``````
set1 = {1, 2, '3', 4, 5}
set2 = {1, '2', 3, '4', '5'}
set3 = set1.intersection(set2)
print(set3)
``````

### Question 14: What is the output of the following code?

``````
dict = {'name': 'Leo', 'age': '17', 'type': 'name'}
print(dict['name'])
``````

### Question 15: Write a print statement to print out the type of the following. After writing the code use a comma and then write what you think the type is

``````
x = (3, 6, 7, [20, 1, 3, True])
``````

Score =

## Next ❯

Copyright © 2020, Q-Programming | Created by Arjun Sodhi, Balpreet Juneja and Sammarth Kumar | Developed and Designed by Sammarth Kumar