Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Lab 2.01. The bonus seems out of place #420

@Dan-TEALS

Description

@Dan-TEALS

Discussed in #330

Originally posted by jdonwells February 3, 2022
The bonus to lab 2.01 has to use conditional statements which the kids don't know yet.

So I changed it to this:
In your editor
Create a program that will take an input and print out that input multiplied by 2.
Does it work if you enter a float like 1.6? Can you fix it?
Make your program print the result as an integer, then as a float, and again as a string that is repeated twice.

Printing as an integer will require them to cast twice. 1.6*2 as an integer should print 3, not 2. Example solution:

number = input('Enter a number: ')
print(int(float(number) * 2))
print(float(number) * 2)
print(number * 2)

Metadata

Metadata

Assignees

Labels

BugIntroCS.2Low SeverityCosmetic issue that doesn't affect usability of a lesson

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions