Question: Exercise 1 1. Print a message to the console. 2. Create a variable and assign it a value, then print the value of the variable.
Exercise 1 1. Print a message to the console. 2. Create a variable and assign it a value, then print the value of the variable. 3. Create a function that takes two numbers as arguments and returns the sum of the numbers. 4. Use a conditional statement to check if a number is greater than 5 and print a message if the condition is true. 5. Create a list of numbers, iterate over the list, and print each number to the console. 6. Create a dictionary of key-value pairs representing information about a person, and print the value associated with a specific key. 7. Create a function that takes a list of numbers as an argument and retums the sum of the numbers. 8. Create a function that takes a string as an argument and returns the length of the string. 9. Create a loop that iterates over a list of strings and prints each string to the console. 10. Create a function that takes a number as an argument and returns a list of numbers from 1 to the argument value. Exercise 2 Write a program that takes a list of numbers as an input, and returns a pew list that contains only the even numbers from the input list. The program should use a loop to iterate over the input list, and a conditional statement to check if each number is even. It should then append the even numbers to an new list, and return that list
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
