Online · Bekasi · Indonesia

mBlock STEM Robotics Starter Course for Bekasi Students

An mBlock STEM robotics starter course for Bekasi students lets learners write visual algorithms that control motor drives, distance sensing and light indicators—on screen first, optional hardware later.

mBlock Bekasi

Video coming soon

Lesson notes and Q&A below are available now. The video will appear here when published.

1. Introduction to Type Conversion (Typecasting)

Type conversion (often referred to as typecasting) is the process of changing a value from one data type into another. For example:

  • Converting an integer to a string if you need to apply string-based operations to it.
  • Converting a string containing digits into an integer or float so that mathematical calculations can be performed.
ConversionExampleResult
String to Integerint("34")34 (calculable)
String to Floatfloat("34.5")34.5 (decimal)
Number to Stringstr(100)"100" (text)

2. Converting Numeric Strings to Integers

When numerical data is enclosed in quotation marks (such as "34"), Python treats it strictly as text (str). To convert a numeric string into an integer, pass the variable into the built-in int() function:

age = "34"
print(type(age))
# Output: 

print(int(age) + 1)
# Output: 35

The same principle applies when converting text representations of decimals into floating-point numbers using float().

3. Getting User Input with the input() Function

Python provides the built-in input() function to prompt the user for keyboard data:

age = input("Please write your age: ")

When this line executes, Python displays the prompt and waits until the user types a response and presses Enter.

4. The Golden Rule of input(): Everything Arrives as a String

The input() function always returns user input in string (str) format—even if the user types digits like 71 or 25:

age = input("Please write your age: ")
# User enters: 71
print(type(age))
# Output: 

Because the value is stored as a string, you cannot immediately execute mathematical calculations with it.

5. Typecasting User Input for Computations

To perform calculations on numbers collected from the user, convert the string into an integer using int():

age = input("Please write your age: ")
my_age = int(age)
print(type(my_age))
# Output: 

next_year_age = my_age + 1
print("Next year you will be:", next_year_age)

Once converted, the program can execute any arithmetic operation without errors.

Lesson Q&A

Type conversion is the process of converting a variable from one data type into another (for example, a string into an integer or float). It is necessary because data often arrives in a format that cannot be used in arithmetic until it is explicitly cast into a numeric type—or into a string when text-based manipulations are required.

The input() function always returns data in string (str) format, regardless of what the user types. Even whole numbers like 71 or 25 are stored as text, which you can verify with type().

Convert the string input into an integer or float before performing math:

age = input("Please write your age: ")
my_age = int(age)
print(my_age + 1)

What children can learn

WhatsApp +92 322 421 7059

AI and Robotics Club | The 100 Mission AI & Robotics Hero Journey

Recommended self-paced course for parents & educators

mBlock Coding Fast Track for Beginners on Udemy.

Disclosure: This page contains affiliate links. We may earn from qualifying purchases at no extra cost to you. Links are intended for parents and educators, not as marketing directed at young children.

Visual Algorithms Meet Motion: mBlock Practice for Bekasi Learners

Bekasi families gain from visual robotics that stays optional on hardware. Enquire WhatsApp +92 322 4217059. No invented Bekasi studio.

Frequently asked questions

What makes mBlock effective for young STEM robotics learners in Bekasi?

mBlock combines the drag-and-drop simplicity of Scratch visual block programming with real hardware control. Bekasi students write visual algorithms that operate physical mBot motors, distance sensors, and LED lights in real time.

Can Bekasi students join the mBlock program online without buying physical hardware first?

Yes! We utilize interactive software robotics simulators during online live sessions, enabling students to program and test robot movements on screen prior to purchasing physical kits.

How can I request a free mBlock demo session for my child in Bekasi?

Click the WhatsApp button on this page to connect with our admissions desk and secure a free live trial pass for this week.

Explore related learning

BSDArduino · BSD City South JakartaRobotics · South Jakarta BandungSTEM · Bandung