Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
Two names get new values in one assignment, and the new value of b uses a. What does the program print?
Python Programming
Easy
High School (9–10)
Python Basics › Variables and Data Types
PCEP (Python Institute)
Created by
StemPy Lab
Stuck? Show a hint
Two names get new values in one assignment, and the new value of
b
uses
a
.
a, b = 1, 2 a, b = b, a + b print(a, b)
What does the program print?
2 3
2 4
1 3
2 1
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← Two short functions are defined. One gives back a slice, and the other adds an item to a list. Which of these comparisons are True? Choose two.
A function asks a question with input() and a prompt. The user types 4 and presses Enter. Do not count the characters the user types. What text does the program itself write on the screen? →
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 →