Answer:
def length( mystring):
count = 0
for i in mystring:
count += 1
return count
def reversed( mystring):
strlist = []
for i in range(length(mystring)):
strlist.append(mystring[(length(mystring) - 1) - i])
txt = "".join(strlist)
return txt
string = 'Yolanda'
print(reversed(string))
Explanation:
The python module defines two functions 'reversed' and 'length'. The length function counts the number of characters in a string variable while the reversed function reverses the string variable value.
<u>Best method to sort data:</u>
Best method to sort for data people use excel sheet. If we have 4 quarter sales data of each select man wise.
1. Open the MS Excel
2. Create blank sheet
3. Create list of salesman and quarter sales in each cells from A1….
4. Select all whole worksheet and paste it the data
5. Once data is copied, custom list is created and select advanced options dialog box, select required field and sorting is achieved.
This is simple’s method for sort the list based on the names of the first four gas in ascending order.
Answer:
The phenomenon of total internal reflection of light is used in many optical instruments like telescopes, microscopes, binoculars, spectroscopes, periscopes etc. The brilliance of a diamond is due to total internal reflection. Optical fibre works on the principle of total internal reflection.
Explanation:
thank me later but if it wrong. sorry
Answer:
// here is code in c++.
// include header
#include <bits/stdc++.h>
using namespace std;
// main function
int main()
{
// variables to read input
int userNum,x;
cout<<"enter the value of userNum and x :";
// read the input from user
cin>>userNum>>x;
// divide the userNum with x 4 times
for(int a=0;a<4;a++)
{
userNum=userNum/x;
cout<<userNum<<" ";
}
cout<<endl;
return 0;
}
Explanation:
Declare two variables "userNum" and "x". Read the value of these. Run a for loop 4 time and divide the "userNum" with "x" and print the value of "userNum".
<u>Output:</u>
enter the value of userNum and x :2000 2
1000 500 250 125