Python logical practice questions:

 

Question: 1 FizzBuzz Problem: Write a Python program that prints the numbers from 1 to 100. But for multiples of 3, print "Fizz" instead of the number, and for the multiples of 5, print "Buzz." For numbers that are multiples of both 3 and 5, print "FizzBuzz."

 

Question: 2 Write a Python function to calculate the factorial of a non-negative integer.

 

Question: 3 print series : 

1
2
333
4
55555
6
7777777
8
999999999
10

 

Question: 4 Find the common words:

lst1 = ["car", "bus", "train", "plan", "bike", "hlo"]
lst2 = ["bike", "hlo", "no", "yes", "done", "bus"]

 

Question 5

 a = "this is a car"

Expected output : 

 ("this", "is", "a", "car")

 

Question: 6 We have:

x = 123456899191

Expected output :

1
3
6
1

 

Question: 7 Print Series:

1
3
12
48
192
768

 

Question: 8 Find the smallest number without using any function:

a = 127313202319863

 

Question: 9 Print Series:

0
1
1
2
3
5
8
13
21
34
55

 

Leave a comment

You must be logged in to post a comment.

0 Comments