A. 0 B. 1 C. 2 D. 3 E. 4 5. For which one of the following statements, x[0] Aut 1 does NOT cause an ERROR? A. x = [1,2,3,4,5] B. x = (1,2,3,4,5) C. x= "1,2,3,4,5" D. x = range(1,5) E. x = 1,2,3,4,5
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
please solve parts 5 and 6
![**Question 1**
1. **What is printed by the following statements?**
```python
course={'Title':'Python','ID':'0107200','Enrollments':100}
course['Enrollments']= course.get('Enrollments',0)+1
print(course)
```
- A. `Title: 'Python', 'ID': '0107200', 'Enrollments': 101`
- B. `Title: 'Python', 'ID': '0107200', 'Enrollments': 1`
- C. `Title: 'Python', 'ID': '0107200', 'Enrollments': 0`
- D. `Title: 'Python', 'ID': '0107200', 'Enrollments': 100`
- E. `Title: 'Python', 'ID': '0107200', 'Enrollments': 101`
- F. Syntax Error
2. **What is printed by the following statements?**
```python
lst = [1,2,3,4,5,6,7]
print(lst[-1])
```
- A. -1
- B. 1
- C. 6
- D. 7
- E. Syntax Error
3. **What is printed by the following statements?**
```python
course={'Title':'Python','ID':'0107200','Enrollments':100}
for k,v in course.items():
print(k,v)
```
- A. `Title Python` \
`ID 0107200` \
`Enrollments 100`
- B. `Title ID Enrollments` \
`Python 0107200 100`
- C. `Title: 'Python', 'ID': '0107200', 'Enrollments': 100`
- D. `Title: 'Python',` \
`'ID': '0107200',` \
`'Enrollments': 100`
- E. Syntax Error
4. **How many syntax errors in the following code?**
```python
def welcome(msg):
if len(msg.split()))==2:
msg+= "We are Fine"
return msg
reply= welcome('Hi All')
```
- A. 0
- B. 1
- C. 2
- D. 3
- E. 4
5. **For which one of the following statements, x[0] =](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F76a354f1-3b7e-4380-8f29-ee66160bd76d%2Fb145953d-0d4b-47c5-90c6-1b81c16b45fe%2F2k2rse2_processed.jpeg&w=3840&q=75)

Step by step
Solved in 2 steps









