Day 5
Objective: Build a program that identifies data types!
OPEN GOOGLE COLAB(Click to open in a new tab)
int (Integers/Whole numbers)float (Decimals)str (Text)The input() function ALWAYS receives information as Text (String), even
if you type a number!
If you write:
And the user types 15, Python sees "15" (text), NOT the number 15. To use
it as math, you must CAST it.
Follow these steps in your Google Colab notebook:
Create a new notebook and name it: Data_Types_Practice_YourName
Create a variable named user_input. Use input() to ask the user to type
something.
Your code must try to "guess" the data type:
Use if, elif, and else to print the result.
Reminders:
:Paste your code from Google Colab here to check your score. (Note: Copy/Paste is disabled. You must type manually to verify your understanding!)
input() function correctly.
try/except).
int(), float(),
if/elif).
#) explaining the code.
This certifies that
Has successfully built the
Data Identity Detector!
Python Path - Day 5