Print characters from a string that are present at an even index number
string = "schokolade"
def print_Even_Number():
# your code
Print "True" if the first and last number of a list is the same
numbers_x = [10, 20, 30, 40, 10]
numbers_y = [75, 65, 35, 75, 30]
def last_same_as_first(numbers):
# your code
Return the count of a given substring (not case sensitive) from a string.
str = "Spiderman is not even a real spider"
sub_str = "spider"
def spider_counter(str, sub_str):
# your code
Create a new list from a two list using the following condition.
Given a two list of numbers, write a program to create a new list such that the new list should contain odd numbers from the first list and even numbers from the second list.
list1 = [10, 20, 25, 30, 35]
list2 = [40, 45, 60, 75, 90]
def combine_lists(list1,list2):
# your code
Return a random greeting and question from data.json
def random_greeting():
# your code
return greeting
List all answers found in data.json
under the 5th question in a Markdown Table
def answers_to_markdown():
# your code
Open a new file yahoo_users.py
.
Return the percentage of users in table.csv
who have their mail hosted by "yahoo.com".
round to 2 decimals e.g. 42,02
def who_uses_yahoo():
# your code
return percentage
Run all previous functions from a single file depending on a User input.
E.g. List all options that can be run with a co-responding number. Then the user inputs the color and the function runs.
- make use of imports
- use case switches