Computer Science
What is the output of the following ?
x = 123
for i in x:
print(i)
- 1 2 3
- 123
- Error
- Infinite loop
Related Questions
Which of the following Python functions is used to iterate over a sequence of numbers by specifying a numeric end value within its parameters ?
- range()
- len()
- substring()
- random()
What is the output of the following ?
d = {0: 'a', 1: 'b', 2: 'c'} for i in d: print(i)
1.
0 1 2
2.
a b c
3.
0 a 1 b 2 c
4.
2 a 2 b 2 c
Which arithmetic operator(s) cannot be used with strings ?
- +
- *
- -
- All of these
What will be the output when the following code is executed?
>>> strl = "helloworld" >>> strl[ : : -1]
- dlrowolleh
- hello
- world
- helloworld