Say "Hello, World!" With Python

Here is a sample line of code that can be executed in Python: print("Hello, World!") You can just as easily store a string as a variable and then print it to stdout: my_string = "Hel

View Solution →

Python If-Else

Task: Given an integer, n , perform the following conditional actions: If n is odd, print Weird If n is even and in the inclusive range of 2 to 5 , print Not Weird If n is even and in th

View Solution →

Arithmetic Operators

The provided code stub reads two integers from STDIN, a and b. Add code to print three lines where: 1.The first line contains the sum of the two numbers. 2.The second line contains the differen

View Solution →

Mini-Max Sum

Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single

View Solution →

Python: Division

The provided code stub reads two integers, a and b, from STDIN. Add logic to print two lines. The first line should contain the result of integer division, a//b . The second line should contain th

View Solution →

Birthday Cake Candles

You are in charge of the cake for a child's birthday. You have decided the cake will have one candle for each year of their total age. They will only be able to blow out the tallest of the candles. Co

View Solution →

Loops

Task: The provided code stub reads and integer, n , from STDIN. For all non-negative integers i<n, print i^2. Example: n=3 The list of non-negative integers that are less th

View Solution →