Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PROGRAMMING PYTHON LAST 2 DIGITS OF ID =63210048 1. Question 1 (40 points). Do not forget to write your name and student ID in your

PROGRAMMING PYTHON

LAST 2 DIGITS OF ID =63210048image text in transcribed

1. Question 1 (40 points). Do not forget to write your name and student ID in your answer to each question. Part (a) Create a list named list1 whose elements are the dig- its in your student ID number. Write a Python function named Squares which receives a list of numbers as an input argument and prints a list whose elements are squares of numbers in the input list. Call the Squares function by giving list1 as its in- put argument. Show the steps of your work clearly, including the steps for creating list1, defining Squares function, and calling Squares by giving list1 as its input argument. Part (b) Consider the function below (i.e., myfunction()). What value will be returned for the following call: myfunction(-40+ last 2 digits of your student ID number)? def myfunction(n): if (n > 0): n=n*4 return n else: n=n + 10 if (n%2 == 1): n=n+1 return n

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions