Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

15. Define a function named t_1 which will print Hello World! In (1): #Type your answer here. f_10 NameError Traceback (most recent call last) /var/folders/21/r_jhahks6v3ftsjkn@xmp580098gn/T/ipykernel_88702/1391340867.py

image text in transcribed
image text in transcribed
image text in transcribed
15. Define a function named t_1 which will print "Hello World!" In (1): #Type your answer here. f_10 NameError Traceback (most recent call last) /var/folders/21/r_jhahks6v3ftsjkn@xmp580098gn/T/ipykernel_88702/1391340867.py in 3 4 ----> 5 f_10 NameError: name 'f_1' is not defined 16. Now define the same function t_1 and assign it to variable ans 1. See what happens. In : #Type your code here. def f_10: print("Hello world!") ans_1- print(ans_1) 17. Now define the same t1 function this time so that it returns a value instead of just printing it.. In : #Type your answer here. ans_1=f_10 print(ans_1) 18. Now create a function named f_1 which both prints and returns "Hello World! In (): # Type your answer here. ans_1=f_10 print(ans_1) 19. Create a function named f_1 which always returns the number: 100. In (): # Type your answer here. print(f_1(999)) 20. Create a function named 1 which takes an integer as input and then returns it. In 1: # Type your answer here. print(f.1(44)) 21. Can you define a function that takes a list as input and returns the reverse of that list? In (): # Type your answer here. Ist=[100, 200, 300, 400,500) f_1(1st) print(lst)

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

Essential Practices For Managing Chemical Reactivity Hazards

Authors: Robert W. Johnson, Steven W. Rudy, Stephen D. Unwin

1st Edition

0816908966, 978-0816908967

More Books

Students also viewed these Chemical Engineering questions