Input(), Print(), and Operators
Understanding how to take input, display output, and use basic operators is essential for programming. These are the building blocks to create dynamic and interactive programs. Here are some beginner-friendly exercises to get you started.
Practice Problems
Problems Index
- Input marks in 3 subjects and find the total and percentage.
- Input name, hobby, and age, then print them as a paragraph.
- Take a string and repeat it
n
times (using*
). - Input two numbers and print them separated by a custom separator.
- Print a message on one line and another message on the same line using the
end
argument. - Input marks in two subjects and calculate their average.
- Input the length and breadth of a rectangle and calculate its area.
- Input the cost of an item and the quantity purchased, then calculate the total cost.
- Input two numbers and swap their values using a temporary variable.
- Input the base and height of a triangle and calculate its area.
Try It Yourself
Now that you’ve reviewed the problems, practice them below using the code runner!