# CSC 201

Introduction to Python Programming

Course Synopsis

This course is designed for a semester in Python Programming language for undergraduate Computer Science, Mathematical Science and Engineering students. The course covers general concepts and introduction to Python Programming.  Even though the course may not, in to full details, give everything the students need, it covers the basic features needed to be a good Python programmer and an introduction to the important new features of Python idle. This course has found profound and significant applications in Engineering, Mathematics, Computer Science, and other related fields.

0%
132

CSC 201

Just a practice. Coined from past questions

25 questions

10 minutes

1 / 25

1. Which one of these is floor division?

2 / 25

2. What is the output of the following?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1

3 / 25

3. Int(x) means variable x is converted to integer.

4 / 25

4. What is the maximum possible length of an identifier?

5 / 25

5. In order to store values in terms of key and value we use what core datatype.

6 / 25

6. What is the output of the following?
sentence = 'horses are fast'
regex = re.compile('(?P<animal>\w+) (?P<verb>\w+) (?P<adjective>\w+)')
matched = re.search(regex, sentence)
print(matched.groups())

7 / 25

7. Given a function that does not return any value, What value is thrown by  default when
executed in shell.

8 / 25

8. What is the output of the following?

d = {0: 'a', 1: 'b', 2: 'c'}
for i in d:
print(i)

9 / 25

9. You can perform mathematical operation on String?

10 / 25

10. What is the output of the following?
d = {0, 1, 2}
for x in d:
print(x)

11 / 25

11. What is the output of the following?
d = {0: 'a', 1: 'b', 2: 'c'}
for x, y in d.items():
print(x, y)

12 / 25

12. The output of executing string.ascii_letters can also be achieved by:

13 / 25

13. Select all options that print
hello-how-are-you

14 / 25

14. The following is displayed by a print function call:
tom
dick
harry
Select all of the function calls that result in this output

15 / 25

15. What is the output of the following?
d = {0, 1, 2}
for x in d:

16 / 25

16. What is the output of the following?
x = 'abcd'
for i in range(len(x)):
print(i.upper())

17 / 25

17. What is the output of the following?
x = "abcdef"
i = "i"
while i in x:
print(i, end=" ")

18 / 25

18. What is the output of the following?
x = "abcdef"
i = "a"
while i in x[1:]:
print(i, end = " ")

19 / 25

19. Which of the following will run without errors(multiple answers possible) ?

20 / 25

20. Which is the correct operator for power(x^y)?

21 / 25

21. What is the output of the following?
x = ['ab', 'cd']
for i in x:
i.upper()
print(x)

22 / 25

22. What is the output when following statement is executed ?
>>>print '\x97\x98'

23 / 25

23. What is the output of the following?
i = 5
while True:
if i%0O9 == 0:
break
print(i)
i += 1

24 / 25

24. What is the output of the following?
x = "abcdef"
i = "a"
while i in x:
print('i', end = " ")

25 / 25

25. What is the output of the following?
x = 'abcd'
for i in range(len(x)):
x[i].upper()
print (x)