Answer:
The expression is "t[k]".
Explanation:
In the question, it is defined that variable k refers to positive integer and variable t refers to a tuple that holds at least k+1 element. The expression for defining the kth element of t is t[k].
- Where variable t is tuple that collects a sequence of immutable (in-built) Python objects. To define tuple we use the parentheses.
- The main purpose to use tuple in this question is that it cannot be changed.
firstly we have to initialize the variable, means to give variable a value and then print the statement
string = "fahadisahadam"
print(string[:3]+"..."+string[-3:])
string is a data type that contains two or more characters.
means the string is fahadisahadam so the print will print first three characters. follow by three periods(...) and then last three characters.
The output will be:
fah...dam
Answer:
Computer keyboard,Microphone,Image scanner,Touchscreen,light pen
Explanation:
sorry that all device i know
Answer:
the indexOf() method
Explanation:
The indexOf() method in java returns the first occurrence of the of the string or a character specified in it.It can be used to search both a character or a string.
for example:-
import java.util.*;
import java.lang.*;
import java.io.*;
class indexOf
{
public static void main (String[] args)
{
String s="IamNumber4";
int l=s.indexOf("Num");//using indexOf() method on string object..
System.out.println(l);
}
}
Output:-
3