0% found this document useful (0 votes)
3 views3 pages

test one

The document contains a series of multiple-choice questions related to Python programming, covering topics such as data types, operators, and basic syntax. It includes questions about Python's creator, file extensions, and various programming concepts. Additionally, it provides practical programming tasks for users to complete.

Uploaded by

ihr18c
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)
3 views3 pages

test one

The document contains a series of multiple-choice questions related to Python programming, covering topics such as data types, operators, and basic syntax. It includes questions about Python's creator, file extensions, and various programming concepts. Additionally, it provides practical programming tasks for users to complete.

Uploaded by

ihr18c
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/ 3

1.

Python is a: c) decimal
a) High-level programming language d) float
b) Assembly language
9. What will be the result of 10 + 5 * 2?
c) Machine language
a) 30
d) None of the above
b) 25
2. Who developed Python? c) 20
a) Charles Babbage d) 15
b) Dennis Ritchie
10. Python is:
c) Guido van Rossum
a) Case-insensitive
d) James Gosling
b) Case-sensitive
3. Python files are saved with extension: c) Compiler-based only
a) .p d) Platform-dependent
b) .py
11. What does int("10") return?
c) .python
a) "10"
d) .pt
b) 10.0
4. Which of the following is a dynamic typed c) 10
language? d) Error
a) C
12. Which operator is used for modulus?
b) Java
a) /
c) Python
b) //
d) C++
c) %
5. What will be the output of: print("Hello", d) **
"World")?
13. Strings in Python are:
a) HelloWorld
a) Mutable
b) Hello,World
b) Immutable
c) Hello World
c) Changable
d) Error
d) None of the above
6. What is the output of type(3.14)?
14. Which method returns the length of a
a) int
string?
b) str
a) str.length()
c) float
b) len()
d) complex
c) size()
7. Which of the following is used to take input d) length()
from the user?
15. Which of the following is a valid variable
a) cin
name in Python?
b) input()
a) 123name
c) scanf()
b) my-name
d) gets()
c) my_name
8. Which of these is not a valid Python data d) my name
type?
16.Which of these is not a string method?
a) int
a) upper()
b) str
b) append() 24. Which of these is not a string method?
c) strip() a) upper()
d) replace() b) append()
c) strip()
d) replace()
17.Which of these is not a string method?
25. What does print(bool(0)) return?
a) upper()
a) True
b) append()
b) False
c) strip()
c) Error
d) replace()
d) None
18. What will len("Python") return?
Practical Questions Any Five
a) 5
b) 6 Q1. Write a program to accept a number from
c) 7 the user and display its square.
d) Error
Q2. Create variables to store your name, age,
19.Which keyword is used to define a variable and grade, and print them.
in Python?
Q3. Write a program to swap two numbers
a) var
without using a third variable.
b) let
c) define Q4. Write a Python script to check whether a
d) No keyword needed given number is divisible by 5 or not.

20. What is the output of print(10 > 5)? Q5. Write a program to take input of name and
a) True print a greeting like "Hello, <name>!"
b) False
Q6. Write a program to find the remainder
c) Error
when a number is divided by 3.
d) None
Q7. Take a string and print its first and last
21. Which operator is used to check if two
character.
values are equal?
a) = Q8. Convert the string "100" into integer and
b) := perform addition with 50.
c) ==
Q9. Write a program to check if a number is
d) ===
positive, negative, or zero.
22. What will print("Python"[2]) output?
Q10. Write a program to print the ASCII value of
a) t
a character taken from user.
b) y
c) h
d) o

23. What is the result of 5 // 2?


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

You might also like