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

Question Bank On Module 1 Modifed

Uploaded by

yashaswini0005
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)
17 views4 pages

Question Bank On Module 1 Modifed

Uploaded by

yashaswini0005
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

Module I

Question bank

1. Explain the concept of type conversion functions and math conversions in python with
suitable examples
2. Explain the working of while loop with suitable example
3. Briefly explain the working of range() function
4. Demonstrate the usage of break and continue statements in looping structures using
5. What is a variable? List the rules to declare a variable in python? Demonstrate the same
6. List the features of Python Programming Language
7. Briefly explain the working of definite loop in python
8. Which of the following are operators, and which are values?
*
'hello'
-98.8
-
/
+
5
9. Name three data types. Explain each in details.
10. What should the following two expressions evaluate to?
'abc' + 'abcabc'
'raju' * 3

11. What three functions can be used to get the integer, floating-point number, or string
version of a value?
12. What are the two values of the Boolean data type? How do you write them?
13. write the difference between formal language and natural language.
14. What are the three Boolean operators? Write out the truth tables of each Boolean
operator (that is, every possible combination of Boolean values for the operator and what
they evaluate to).
15. What do the following expressions evaluate to?
(5 > 4) and (3 == 5)
not (5 > 4)
(5 > 4) or (3 == 5)
not ((5 > 4) or (3 == 5))
(True and True) and (True == False)
(not False) or (not True)
16. What are the six comparison operators?
17. What is the difference between the equal to operator and the assignment operator?
18. Explain what a condition is and where you would use one.
19. Identify the three blocks in this code:
spam = 0
if spam == 10:
print('eggs')
if spam > 5:
print('bacon')
else:
print('ham')
print('spam')
print('spam')
20. Write code that prints Hello if 1 is stored in spam, prints Howdy if 2 is stored in spam,
and prints Greetings! if anything else is stored in spam.
21. What is the difference between break and continue?
22. What is the difference between range(10), range(0, 10), and range(0, 10, 1) in a for
loop?
23. Write a short program that prints the numbers 1 to 10 using a for loop. Then write an
equivalent program that prints the numbers 1 to 10 using a while loop.
24. If you had a function named bacon() inside a module named spam, how would you call
it after importing spam?
25. Give the output of the following :
1.
range(10)
range(1,11)
range(0,30,5)
range(0,-9,-1)

2. spam = 0
if spam < 5:
print('Hello, world.')
spam = spam + 1

3. spam = 0
while spam < 5:
print('Hello, world.')
spam = spam + 1

26. Mention the advantage of continue statement. Write a program to compute only even
numbers sum within the given natural number using continue statement.

27.Identify errors.

1. >>> true

2. >>> 42 + 5 + * 2

3. >>> 'Alice' + 42

28. Write a program to display even numbers between 10 and 20.

29. Write logical expressions for the following :

1. Either A is greater than B or A is less than C


2. Name is Snehith and age is between 18 and 35.
3. Place is either Mysore or Bengaluru but not “Dharwad”.

30. Write a Flow chart and Python program for the following:

1. To find the average of two numbers.


2. To find the simple interest given the value of P,T and R
31. Complete the below code .

1.Write a program to find the number of minutes in a day.

// To find the number of minutes in a day

… Write your statement here ,,,

Print (minutes) // to display number minutes

2.Write a program to declare the result of a student whose marks in a course is given. Passing
marks is 40.

// To declare the result of given marks

Mark=input()

,,, Your statement here ,,,

32. Identify the function to be used from the given basket, for each of the below cases.

The basket of functions- range, type conversion, …

1.To find the persentage of marks scored in a course.

Percentage=marks /100

2.To print all numbers from 1 to 40


For i in …..
Print (i)

3.To print all odd numbers from 1 to 100


For i in …
Print (i)

4.To print all even number from 1 to 100


For i in …..
Print(i)

You might also like