Only approved questions will enter the prompt. Questions repeated across selected lectures are automatically de-duplicated in the final prompt.
IncludedL42: Data types, mutability and object identity Theory part 22025 · 2 mark(s)
Draw a flowchart for a program that accepts an integer input from the user and checks whether the number is even or odd. Display the appropriate message based on the result.
IncludedL42: Data types, mutability and object identity Theory part 22025 · 2 mark(s)
(b) What is None in Python?
IncludedL42: Data types, mutability and object identity Theory part 22025 · 2 mark(s)
What is the purpose of None data type in Python?
IncludedL42: Data types, mutability and object identity Theory part 22025 · 3 mark(s)
Write a Python program that takes an integer input from the user and checks whether the number is prime or not.
IncludedL42: Data types, mutability and object identity Theory part 22025 · 3 mark(s)
Write a Python program that takes an integer n as input from the user and prints the first n terms of the Fibonacci series.
E.g. If the user enters 5, the program should print: 0 1 1 2 3
If the user enters 8, the program should print: 0 1 1 2 3 5 8 13
IncludedL42: Data types, mutability and object identity Theory part 22025 · 3 mark(s)
What are data types? What are Python's built-in core data types?
IncludedL42: Data types, mutability and object identity Theory part 22025 · 4 mark(s)
Write a program to check whether an integer input by the user is a 5-digit number and whether it is prime or composite.
IncludedL42: Data types, mutability and object identity Theory part 22025 · 4 mark(s)
Write a program which accepts a positive integer value and check if it is an Armstrong number or not.
IncludedL42: Data types, mutability and object identity Theory part 22025 · 4 mark(s)
Write a program to accept an integer and check if it is a perfect number or not.
Note:-A perfect number is a positive integer that is equal to the sum of its proper divisors (excluding the number itself).
IncludedL42: Data types, mutability and object identity Theory part 22025 · 4 mark(s)
Write a program to find the GCD and LCM of two positive integers
IncludedL42: Data types, mutability and object identity Theory part 22025 · 5 mark(s)
(i) Write a program in python that accepts two numbers and swap them without using a third variable.
(ii) Write a program in python that accepts a and b two integers and compute the greatest common divisor.
IncludedL42: Data types, mutability and object identity Theory part 22025 · 5 mark(s)
a=int(input("enter an integer"))
b=int(input("enter an integer"))
if a<=0:
b=b+1
else:
a=a+1
if a>0 and b>0:
print("W")
elif a>0:
print("X")
if b>0:
print("Y")
else:
print("Z")
A. What letters will be printed if the user enters 0 for a and 0 for b?
a. Only W
b) . Only X
c) . Only Y
d) W and X e) W,X and Y
B. What letters will be printed if the user enters 1 for a and 1 for b?
a. W and X
b) . W and Y
c) . X and Y
d) . X and Z e). W,X and Y
C. What letters will be printed if the user enters 1 for a and -1 for b?
a. W and X
b) . X and Y
c) . Y and Z
d) . X and Z e). W and Z
D. What letters will be printed if the user enters 1 for a and 0 for b?
a. W and X
b) . X and Y
c) . Y and Z
d) . X andZ e). W and Z
E. What letters will be printed if the user enters -1 for a and -1 for b?
a. Only W
b) Only X
c) Only Y
d) Only Z e) No letters are printed
Reset All Progress?
This will clear all Done and Missed marks and rebuild the schedule from scratch.
A backup will be created automatically before resetting. You can restore it from the Backups page.