Striped Rectangle
Given an integer number
The first line of input is an integer
In the given example the striped rectangular pattern of
7 rows and 5 columns. Therefore, the output should beĀ
Sum of Even numbers
Write a program to find the sum of even numbers in first N natural numbers.
The input is an integer N.
The output should be an integer containing the sum of even numbers upto the given number.
In the given example
N = 5, the even natural numbers below 5 are 2, 4 Then total = 2 + 4
So, the output should be
6.
Remove Vowels in a Sentence
You are given a sentence. Write a program to remove all the vowels in the given sentence.
The first line of input is a string
In the example given a sentence
Hello World, the sentence contains vowels e, o.So, the output should be
Hll Wrld
Letter, Digit or Special Character
You are given a character as input. Check if the given input is a
The first line of input is a single character
In the given example character is
9. So, the output should be Digit.
Palindrome - 3
You are given a string, write a program to find whether the string is palindrome or not.
The first line of input is a string.
The output should be
In the given example, the string
No lemon no melon is a palindrome as we are ignoring spaces. So, the output should be True.
Write a function in this called nine_lines that uses the function three_lines to print a total of nine lines .
Show what happens when a variable defined outside a function has the same name as a local variable inside a function . Explain what happens to the value of each variable as the program runs .
Create a function that takes an argument . Give the function parameter a unique name . Show what happens when you try to use that parameter name outside the function. Explain the results.
Call your function with a local variable . Show what happens when you try to use that variable outside the function . Explain the results.
Create a python code that defines a function that takes an argument . Call the function. Identify what code is the argument and what code is the parameter .Call the function three times with different kinds of arguments : a value , a variable , and an expression . Identify which kind of argument is which .