Answer:
words = ['is', 'NLP', 'fun', '?']
tmp = words[1]
words[1] = words[0]
words[0] = tmp
words[3] = '!'
print(words)
Explanation:
- Create the list
- Assign the new values using <em>tmp</em> variable
- Print the result
Since tuples in Python are unchangeable, you cannot transform the list using tuple assignment.
Answer:
Top down design
Explanation:
Top-down design is an approach that is used to break down the problem into the smaller subpart so that it can be manageable into more clear form.
C programming is the example of a top-down approach while C++ is the example of the bottom-up approach.
The advantages of the top-down design approach are:
1) easy to manage
2) easy to find the error
3) easy to debug
Answer:
The program to this question can be described as follows:
Program:
#include <iostream> //defining header file
using namespace std;
int main() //defining main method
{
int x; //defining integer variable
for(x=0;x<=100;x++) //defining loop to count value from 0 to 100
{
if(x%7==0) //check value is divisable by 7
{
cout<<x<<endl; //print value
}
}
return 0;
}
Output:
please find the attachment.
Explanation:
In the above code, an integer variable x is declared, which is used in the for loop, in this loop variable "x" starts from 0 and ends when the value of x is less than and equal to 100.
- Inside the loop an, if block is used that defines a condition that is (i%7==0), it will check, that the value is divided by 7.
- In this loop, a print method is used, that prints its values.
I think it’s when the party answers