Question 1 Write a function to print “hello_USERNAME!” USERNAME is the input of the function. The first line of the code has been defined as below.   def hello_name(user_name): ..... Question 2 Write a python function, first_odds that prints the odd numbers from 1-100 and returns nothing   def first_odds(): ..... Question 3 Please write a Python function, max_num_in_list to return the max number of a given list. The first line of the code has been defined as below.   def max_num_in_list(a_list): .....

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.1: Function And Parameter Declarations
Problem 11E
icon
Related questions
Question

Question 1

Write a function to print “hello_USERNAME!” USERNAME is the input of the function. The first line of the code has been defined as below.

 

def hello_name(user_name): .....

Question 2

Write a python function, first_odds that prints the odd numbers from 1-100 and returns nothing

 

def first_odds(): .....

Question 3

Please write a Python function, max_num_in_list to return the max number of a given list. The first line of the code has been defined as below.

 

def max_num_in_list(a_list): .....

Question 4

Write a function to return if the given year is a leap year. A leap year is divisible by 4, but not divisible by 100, unless it is also divisible by 400. The return should be boolean Type (true/false).

 

def is_leap_year(a_year): .....

Question 5

Write a function to check to see if all numbers in list are consecutive numbers. For example, [2,3,4,5,6,7] are consecutive numbers, but [1,2,4,5] are not consecutive numbers. The return should be boolean Type.

 

def is_consecutive(a_list): .....

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 10 steps with 7 images

Blurred answer
Knowledge Booster
Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning