Skip to content

kinjumakwana/Python-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Data Types

UPDATE

We've moved away from repl.it for coding exercises. Check out the new exercises on Coding Rooms with automated submissions.

Login to your Udemy course and head over to the link below to get the sign up link:

Click here

Instructions

Write a program that adds the digits in a 2 digit number. e.g. if the input was 35, then the output should be 3 + 5 = 8

Warning. Do not change the code on lines 1-3. Your program should work for different inputs. e.g. any two-digit number.

Example Input

39

Example Output

3 + 9 = 12

12

e.g. When you hit run, this is what should happen:

Hint

  1. Try to find out the data type of two_digit_number.
  2. Think about what you learnt about subscripting.
  3. Think about type conversion.

Test Your Code

Before checking the solution, try copy-pasting your code into this repl:

https://repl.it/@appbrewery/day-2-1-test-your-code

This repl includes my testing code that will check if your code meets this assignment's objectives.

Solution

https://repl.it/@appbrewery/day-2-1-solution

About

Want to join the course? Start your journey here: https://100daysofpython.dev/

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published