Home › Forums › Python Functions › Record Answers Here for lesson 22nd March 2022
- This topic has 19 replies, 14 voices, and was last updated 3 years, 3 months ago by
aanya03.
- AuthorPosts
- March 22, 2022 at 3:44 am #7459
May07
ParticipantPython Program 2:
Ceil()= round up
Floor()= round down
helps with finding the smallest and largest integer.March 24, 2022 at 6:55 am #7461Hayeon Kim
ParticipantCan a function have more than 1 argument?
Can arguments be stored in variables?
If a function contains more than one argument, do you think the order of the arguments makes a difference? Explain your answer.Yes, a function can have more than one argument, only if it matches the subject and is placed in the right location.
Yes, arguments can be stored in variables, because sometimes the arguments might be displayed.
I believe the order of the arguments do not make a difference, since things stated are things that are stated. Therefore, in whatever order the argument is made, I think it doesn’t matter, since it still states things that should be stated.March 24, 2022 at 7:00 am #7462Hayeon Kim
ParticipantRun the program multiple times, and write down the output below. What is the purpose of “import random”? What happens if you omit that line of code?
– The purpose of the “Import random” is to randomize the variable and function. However, when I tried omitting the code, it did not work.How could you change the arguments of the randint function to choose a random number within the range of 4 to 10?
– You have to replace 1-100 with 4-10.March 24, 2022 at 7:03 am #7463Hayeon Kim
Participanta. Explain what the ceil() function does.
– The ceil() function returns the smallest value that is greater than or equal to a certain number.b. Explain the purpose of the floor() function.
– Opposite to the ceil() function, the floor() function returns the greatest value that is less than or equal to a certain number.c. Why are the calls to the floor() and ceil() functions preceded by “math.”?
– It’s used because it has to find the smallest/largest integer related to the given number.April 15, 2022 at 6:58 am #7465aanya03
ParticipantCan a function have more than 1 argument?
Yes, if can have more than 1 argument if the arguments are placed and combined correctly.Can arguments be stored in variables?
Yes, it can be stored in variables because a function can be assigned in variables.If a function contains more than one argument, do you think the order of the arguments makes a difference? Explain your answer.
Yes, if there is more than one argument, then the difference will affect on the order of the printed function. - AuthorPosts
- You must be logged in to reply to this topic.