Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
Half of seven is turned into a whole number in two ways: by rounding it and by converting it with int(), for the positive and the negative value. What is the output?
Python Programming
Medium
High School (9–10)
Python Basics › Variables and Data Types
PCEP (Python Institute)
Created by
StemPy Lab
Stuck? Show a hint
Half of seven is turned into a whole number in two ways: by rounding it and by converting it with
int()
, for the positive and the negative value.
a = 7 / 2 print(a, round(a), int(-a), round(-a))
What is the output?
3.5 3 -3 -3
3.5 4 -4 -4
3.5 4 -3 -4
3 4 -3 -4
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← A program converts values with int(), str() and float() before it uses them. What does the program print?
Bitwise operators work on the binary digits of whole numbers. Each line below combines 6 and 3, or shifts 1, and compares the result with ==. Pick every comparison that comes out True. More than one may be right. →
More on
Python Basics › Variables and Data Types
Discussion (0)
Log in
to join the discussion.
Loading…
All questions on this topic →
Problems on this topic
Each of these three programs stops with an error…
Easy
Say what the type of each result is, and what value it has. Decide on paper first.
Medium
A student wants to swap a and b, and writes…
Easy
Trace the program
Medium
All problems on this topic →