Ans:- Using Background Styles button present in Background group on the Design tab.
Making the file read-only will not allow the file to be rewritten again. For this, we need to modify the permissions of the file. To achieve this, we will make use of the os module in Python more specifically, the chmod() of the os module.
The coding part is extremely simple and will contain very few lines as we are not doing much but changing the permissions. Using the chmod(), we can change the mode of the path, setting it to any mode using the suitable flags from the stat module. Both these modules come inbuilt with Python and hence you need not install anything additionally.
The entire code to change the file to read-only is as follows;
import os
from stat import S_IREAD
# Replace the first parameter with your file name
os.chmod("sample.txt", S_IREAD)
.
You can verify if the code was executed correctly by checking the file’s permissions. To do that :
Right-click on the file and click properties.
Under the attributes section, you will find the read-only checkbox checked.
I hope you found this article useful and it helped you make a file read-only. You can do more than just making the file read-only by using the appropriate flag from the stat module.
Answer:
public static List<String> listUpper(List<String> list){
List<String> upperList = new ArrayList<String>();
for(String s:list){
s = s.toUpperCase();
upperList.add(s);
}
return upperList;
}
Explanation:
Create a method named listUpper that takes list as a parameter
Inside the method, initialize a new list named upperList. Create a for-each loop that iterates through the list. Inside the loop, convert each string to uppercase, using toUpperCase method, and add it to the upperList.
When the loop is done, return the upperList
Answer:
To first create the header you will user the <h1></h1> tag
Then you will use css to align it to the center h1 {text-align: center;}
Explanation:
Answer:
The answer to the given question is "i=1".
Explanation:
In the given c++ code the we use the for loop. We use this loop when we know exactly how many times it will execute. This loop is also known as entry control loop.
Syntax :
for(initialization; condition ; increment/decrements)
{
C++ statement(s);
}
Example:
for (int i = 1; i < 20; i++)
{
cout<< "Hello";
}
That's why initial statement for the for loop is "i=1".