Data Types Of Python Classwork

  • 6th Grade,
  • 7th Grade,
  • 8th Grade,
  • 9th Grade
  • AP CS
  • IB CS
Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Raja Marwah
R
Raja Marwah
Community Contributor
Quizzes Created: 2 | Total Attempts: 295
| Attempts: 158 | Questions: 16 | Updated: Mar 16, 2025
Please wait...
Question 1 / 16
🏆 Rank #--
Score 0/100

1. Write a program code to print the type of 12.5+12.5

Explanation

The given program code will print the type of the expression 12.5+12.5. The expression 12.5+12.5 performs addition on two float numbers, resulting in a float value of 25.0. The type() function is then used to determine the data type of the result, which in this case is a float.

Submit
Please wait...
About This Quiz
Data Types Of Python Classwork - Quiz

Read the questions very carefully and use PyCharm to solve these problems. Ask Teachers if you have any doubt.

2. What is an output of the following program code:num1 = 5num2 = 8print(type(num1 + num2))

Explanation

The program code defines two variables, num1 and num2, and assigns them the values 5 and 8 respectively. The print statement then outputs the type of the expression num1 + num2, which is the sum of the two variables. The output of this program code will be , indicating that the type of the sum is an integer.

Submit

3. What is an output of the following program code: num1 = 5 num2 = 2 print(type(num1/num2))

Explanation

The output of the program code is because when dividing two numbers in Python, the result is always a float, even if the division is between two integers. In this case, 5 divided by 2 is 2.5, which is a float. The `type()` function is used to determine the data type of a variable or expression, and it returns the data type as a string.

Submit

4. What is an output of the following program code: num1 = 55.5num2 = 5print(type(num1 + num2))

Explanation

The output of the program code is . This is because the variables num1 and num2 are both numbers, with num1 being a float (55.5) and num2 being an integer (5). When we add these two numbers together, the result will be a float. The type() function is used to determine the data type of the result, which in this case is a float.

Submit

5. What is an output of the following program code:num1 = 2num2 = 3print(type(num1**num2))

Explanation

The program code calculates the result of raising the value of num1 to the power of num2 using the exponentiation operator (**). The type() function is then used to determine the data type of the result. The output of the program will be , indicating that the result is an integer.

Submit

6. What is an output of the following program code:num1 = 345num2 = 390print(type(num1//num2))

Explanation

The output of the given program code is . This is because the "//" operator performs integer division and returns the quotient as an integer. In this case, the division of 345 by 390 results in a quotient of 0, which is an integer. The type() function is used to determine the data type of the result, which is 'int' in this case.

Submit

7. What is an output of the following program code:num1 = 11num2 = 48print(type(num1*num2//num1))

Explanation

The output of the given program code is . This is because the program multiplies num1 and num2, and then performs integer division of the result by num1. The result of this calculation is an integer, which is confirmed by the type() function.

Submit

8. What is an output of the following program code: num1 = 5 num2 = 8 num3=6 print(type(num1 *(num2-num3)))

Explanation

The program code calculates the value of num2 minus num3, which is 2. Then, it multiplies the result by num1, which is 5. The output of this calculation is the product of num1 and the difference between num2 and num3, which is 10. The type() function is used to determine the data type of the result, which in this case is an integer.

Submit

9. What is an output of the following program code:num1 = 10num2 = 12num3 = 64print(type((num1-num2)**(num2-num1)//num3))

Explanation

The program code calculates the result of the expression (num1-num2) raised to the power of (num2-num1), divided by num3. The type() function is used to determine the data type of the result. The output of the program will be , indicating that the result is an integer data type.

Submit

10. Write a program code to print the type of 12

Explanation

The given program code uses the `type()` function to determine the type of the value `12`. The `type()` function returns the type of the object passed as its argument. In this case, `12` is an integer, so the program will output ``.

Submit

11. Write a program code to print the type of "123"+"123"

Explanation

The program code is using the "+" operator to concatenate the string "123" with the string "123". The result is the string "123123". The "type()" function is then used to determine the data type of this concatenated string, which is a string.

Submit

12. What is an output of the following program code:num1 = 5num2 = 3print(num1**num2)

Explanation

The given program code calculates the result of raising the value of num1 (which is 5) to the power of num2 (which is 3) using the exponentiation operator (**). The result of 5 raised to the power of 3 is 125, which is the output of the program.

Submit

13. What is an output of the following program code:num1 = 8num2 = 9print(type(num1*num2))

Explanation

The output of the given program code is . This is because the program multiplies the values of num1 and num2, which are both integers, resulting in an integer value. The type() function is used to determine the data type of the result, which is 'int' in this case.

Submit

14. What is an output of the following program code: num1 = 25 num2 = 8 print(type(num1 % num2))

Explanation

The output of the program code is . This is because the modulus operator (%) is used to find the remainder when num1 is divided by num2. In this case, 25 divided by 8 gives a remainder of 1, which is an integer value. The type() function is used to determine the data type of the result, which is an integer.

Submit

15. What is an output of the following program code:str1 = "Hello group1"str2 = " and group2"print(type(str1,str2))

Explanation

type() function takes only one value at a time

Submit

16. Write a program code to print the type of(12+ 12)*(12)

Explanation

The given program code calculates the result of the expression (12+12)*(12) and then prints the type of the result. The expression first adds 12 and 12, resulting in 24. Then, it multiplies 24 by 12, resulting in 288. Finally, the type() function is used to determine the data type of the result, which is an integer.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (16)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Write a program code to print the type of 12.5+12.5
What is an output of the following program code:num1 = 5num2 =...
What is an output of the following program code: ...
What is an output of the following program code: num1 = 55.5num2...
What is an output of the following program code:num1 = 2num2 =...
What is an output of the following program code:num1 = 345num2 =...
What is an output of the following program code:num1 = 11num2 =...
What is an output of the following program code: ...
What is an output of the following program code:num1 = 10num2 = 12num3...
Write a program code to print the type of 12
Write a program code to print the type...
What is an output of the following program code:num1 = 5num2 =...
What is an output of the following program code:num1 = 8num2 =...
What is an output of the following program code: ...
What is an output of the following program code:str1 = "Hello...
Write a program code to print the type of(12+ 12)*(12)
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!