0% found this document useful (0 votes)
28 views

Python Questions

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Python Questions

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Question 1 :

Write a Program to input 2 numbers & print their sum.

Question 2:

Write a program to input side of a square & print its area.

Question 3:

Write a program to input 2 floating point numbers & print their average.

Question 4:

Write a program to input 2 int numbers, a and b.


Print True if a is greater than or equal to b. If not print False. ////////

Question 5:

Write a program to input user’s first name & print its length.

Question 6:

Write a program to find the occurrence of ‘$’ in a String.

Question 7:

Write a program to check if a number entered by the user is odd or even.


Question 8:

Write a program to find the greatest of 3 numbers entered by the user.:

Question 9:

Write a program to check if a number is a multiple of 7 or not.

Question 10:

Write a program to ask the user to enter names of their 3 favourite movies & store them in a
list.

Question 11:

WAP to check if a list contains a palindrome of elements. (Hint: use copy( ) method)

[1, 2, 3, 2, 1] [1,”abc”,”abc”,1]

Question 12:

Write a program (WAP) to count the number of students with the “A” grade in the following
tuple.
[“c”,”d”,”a”,”a”,”b”,”b”,”a”]
Store the above values in a list & sort them from “A” to “D”
Question 13:

Store following word meanings in a python dictionary:


table : “a piece of furniture”,“list of facts & figures”
cat : “a small animal”
You are given a list of subjects for students. Assume one classroom is required for 1
subject. How many classrooms are needed by all students.
”python”,“java”,“C++”,“python”,“javascript”“java”,“python”,“java”,“C++”,“C”

Question 14:

WAP to enter marks of 3 subjects from the user and store them in a dictionary. Start with
an empty dictionary & add one by one. Use subject name as key & marks as value.
Figure out a way to store 9 & 9.0 as separate values in the set.
(You can take help of built-in data types)

You might also like