No student devices needed. Know more
15 questions
Which of the following statements are correct?
The variable names cannot start with a digit.
Variables names in Python are case-sensitive.
Variable names cannot start with the underscore _.
Variable names can be reserved keywords.
What is the data type of print(type(10))
string
int
integer
float
var1 = 1
var2 = 2
var3 = "3"
print(var1 + var2 + var3)
6
33
123
Error. Mixing operators between numbers and strings are not supported
To display the number of data in the list | print(name[index]) | ||
To display the data type | print(type(name)) | ||
To display the order of data in the list | print(len(name)) |
What is the output of the following code?
listOne = [20, 40, 60, 80]
listTwo = [20, 40, 60, 80]
print(listOne == listTwo)
print(listOne > listTwo)
True
True
True
False
False
True
False
False
Create a star shape using the turtle package in Python.
What is the output of the following code?
str = "python"
print (str[1:3])
tho
py
pyt
yth
What is the output of the following code?
for i in range(10, 15, 1):
print( i, end=', ')
10, 11, 12, 13, 14,
10, 11, 12, 13, 14, 15,
11, 12, 13, 14, 15,
None of above
What is the Output of the following code?
for x in range(0.5, 5.5, 0.5):
print(x)
[0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5]
[0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5]
The Program executed with errors
Display numbers from -10 to -1 using for loop.
What is the value of x
x = 0
while (x < 100):
x+=2
print(x)
99
100
101
None of the above, this is an infinite loop
Write a Python program to check vowel or consonant.
In this challenge, a farmer is asking you to tell him how many legs can be counted among all his animals. The farmer breeds three species:
chickens = 2 legs
cows = 4 legs
pigs = 4 legs
The farmer has counted his animals and he gives you a subtotal for each species. You have to implement a function that returns the total number of legs of all the animals.
Write a Python program to find area of triangle with base and height value.
Write a Python program for the classic Hi-Lo guessing game. One player picks a number between 1 and 10 (or 1 and 100), and the other tries to guess the number. If the guess is too high, the guesser tries a lower number. If they guessed too low, they try a higher number. When they guess the right number, they win!
Explore all questions with a free account