Class Test - I
Class Test - I
h
ng
1. What is Python? List some key features of Python.
Si
3. Identify the valid and invalid identifiers from the following: my var, 2name,
privateVar, for, userName123.
sh
5. What are standard data types in Python? Name them.
a = 5
Se
b = "5"
print(a + int(b))
am
print(5>>2)
mb
Answer any 5
ng
1. Write a Python program to swap two numbers without using a third variable.
4. Write a program to take user input and print its data type.
1
Program Correction (Error Detection & Fixing)
1. Find and correct the error in the following code:
h
2name = "Alice"
ng
print(2name)
Si
3. Fix the syntax error in this conditional statement:
x = 10
h
if x > 5
print("x is greater than 5")
as
nd
4. Identify and fix the error in this loop:
for i in range(5)
Se
print(i)