Python_Skill Based Questions (1)
Python_Skill Based Questions (1)
Q.1 WAP that searches for prime numbers from 15 through 25.
Q.3 WAP to compute the result when two numbers and one operator is given by user.
(i) 1 4 7 10 . . . . . . ……40
Q10)
Q11) Given a string S = “CARPE DIEM”. If n is length/2 then what would following return?
(a) S[:n] (b) S[n:] (c) S[n:n] (d) S[1:n] (e) S[n:length-1]
(a) To check whether the string contains digits. (b) To find the occurrence a string within another string.
(c) To convert the first letter of a string to upper case. (d) To convert all the letters of a string to upper case.
(f) To check whether all the letters of the string are in capital letters.
(g) to remove all the white spaces from the beginning of a string.
Q14) Find the errors - s=”PURA VIDA” Print(s[9] + s[9:15])
Q15) WAP to check the given string is palindrome or not.
Q16) What do you understand by mutability?
Q.17) Start with the list[8,9,10]. Do the following using list functions
(a) Set the second entry (index 1) to 17 (b) Add 4, 5 and 6 to the end of the list.
(c) Remove the first entry from the list. (d) Sort the list.
Q18)
Q.19 WAP that creates a third list after adding two lists.
Q.20 WAP a program to generate a list of elements of Fibonacci Series.
Q.21 What do you understand by immutability?
Q.22 Does a slice operator always produce a new Tuple? Ans: Yes