PYTHON FUNDAMENTALS ASSIGNMENTS
1. What are literals in Python? How many types of literals are there in Python?
2. How string literal is represented in Python?
3. What is a statement and expression?
4. What is the role of indention in Python?
5. What are variables?
6. What is dynamic typing in python?
7. Differentiate keyword and identifier.
8. What are tokens in Python?
9. What will be the output of following?
a=20
b=a+1
a=33
print(a+b)
10. What is wrong with following code fragment?
a=20
print(a)
b=33
print(b)
11. What is wrong with following code fragment?
name="freya"
classs=4
print(name+classs)
12. What will be the output of following python code?
a,b=3,4
a,b,c=b,a+3,b-1
print(a,b,c)
13. What will be the output of following python code?
a,b=3,4
c,a=b*4,a+4
print(a,b,c)
14. What will be the output of following python code/code fragment?
a. print(print("vishal"))
b. print("vishal")
print("indian")
c. print("vishal",end=" ") print("indian")
d. a=int(input("enter first no"))
b=int(input("enter second no"))
a,b=b,a
print("a=",a)
print("b=",b)
#if user is entering 5 and then 10
15. Write a Python program to find out the simple interest.
16. Write a Python program to find out the compound interest.
17. Write a Python program to find out the area of the triangle.
18. Write a Python program to find out the circumference of circle.
19. Write a Python program to find out the area of the circle.
20. Write a Python program to convert Celsius to Fahrenheit.
21. Write a Python program to reverse a three digit number.
22. Write a Python program to find out the sum of a three digit number.
23. Write a python to display all of keywords supported by Python.
24. Which of the following is an invalid statement?
a) abc = 1,000,000
b) a b c = 1000 2000 3000
c) a,b,c = 1000, 2000, 3000
d) a_b_c = 1,000,000
25. What is the error of following code : a,b=100?
26. Differentiate block/code block/suite?
27. How comments are given in Python program?