[go: up one dir, main page]

0% found this document useful (0 votes)
5 views4 pages

SDT Ass Day 1

This document outlines an assessment test for the course 'Python for Data Science' coordinated by Mrs. M. Gowsalyaa for the academic year 2024-2025. The test consists of 15 multiple-choice questions covering various Python programming concepts, including variable naming, data types, operators, control flow, loops, and user input. Each question is designed to evaluate the student's understanding of Python fundamentals.

Uploaded by

rajalakshmir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views4 pages

SDT Ass Day 1

This document outlines an assessment test for the course 'Python for Data Science' coordinated by Mrs. M. Gowsalyaa for the academic year 2024-2025. The test consists of 15 multiple-choice questions covering various Python programming concepts, including variable naming, data types, operators, control flow, loops, and user input. Each question is designed to evaluate the student's understanding of Python fundamentals.

Uploaded by

rajalakshmir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

DEPARTMENT OF ARTIFICIAL INTELLIGENCE AND DATA SCIENCE

Name of the Course: Python for Data Science


Course Coordinator: Mrs. M. Gowsalyaa
Academic Year: 2024-2025 (Even)
Name of the Student :
Register Number :
Assessment Test – Day 1

1 MARKS:

1. Which of the following is a valid variable name in Python?


a. 2variable
b. variable_2
c. @variable
d. variable-2

2. What will be the output of type(3.0) in Python?


a. int
b. double
c. float
d. decimal

3. Which operator is used for exponentiation in Python?


a. ^
b. **
c. ^^
d. exp()

4. What is the result of the following expression: 5 // 2?


a. 2.5
b. 2
c. 3
d. 2.0

5. Which of the following is the correct syntax for an if statement in Python?


A. if x > 5 then:
B. if (x > 5)
C. if x > 5:
D. if x > 5
6. What will be the output of the following code?
python
Copy
Edit
x = 10
if x > 5:
print("Greater")
else:
print("Smaller")
A. Smaller
B. Greater
C. Error
D. None

7. Which of the following loop types is not available in Python?


A. for loop
B. while loop
C. do-while loop
D. All are available

8. Which keyword is used to skip the current iteration in a loop?


A. skip
B. pass
C. continue
D. break

9. What will be the output of the following code?


python
Copy
Edit
for i in range(1, 6):
if i % 2 == 0:
print(i, end=" ")
A. 1 2 3 4 5
B. 2 4
C. 1 3 5
D. 0 2 4

10. You want to calculate the sum of numbers from 1 to 10. Which of the following is
correct?
A. sum = range(1, 10)
B. sum = 0; for i in range(1, 11): sum += i
C. sum = 0; while i < 10: sum = sum + i
D. sum = sum(1, 10)

11. Which of the following code snippets finds whether a number is prime?
A.python
Copy
Edit
for i in range(2, num):
if num % i == 0:
print("Not Prime")
break
else:
print("Prime")
B. if num % 2 == 0: print("Prime") else: print("Not Prime")
C. print("Prime")
D. while num != 0: print("Not Prime")

12. In a number guessing game, which function is used to get user input in Python 3?
A. raw_input()
B. scan()
C. input()
D. get()

13. Which loop is most suitable for a menu-driven calculator until the user chooses exit?
A. for loop
B. while loop
C. do-while
D. foreach

14. How can you repeat a pattern like the following using a loop?
Markdown
*
 *
 **
A. Nested for loop
B. Single while loop
C. Recursion
D. Loop with break

15. Which of these mini-projects best applies conditionals and loops together?
A. Image Editor
B. Prime number generator
C. Snake Game
D. Alarm Clock

You might also like