{"id":26172304,"url":"https://github.com/imdarshangk/functions","last_synced_at":"2025-03-11T19:56:00.023Z","repository":{"id":156251743,"uuid":"609597617","full_name":"imDarshanGK/Functions","owner":"imDarshanGK","description":"This repository contains various Python programs that demonstrate the use of functions with and without return values and arguments. The programs cover different mathematical operations and concepts.","archived":false,"fork":false,"pushed_at":"2024-12-13T17:34:35.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-13T18:32:28.910Z","etag":null,"topics":["factorial","function-with-return-with-arguments","function-with-return-without-arguments","function-without-return-with-arguments","function-without-return-without-arguments","functional-programming","functions","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imDarshanGK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-04T16:57:43.000Z","updated_at":"2024-12-13T17:34:39.000Z","dependencies_parsed_at":"2024-07-25T01:18:05.642Z","dependency_job_id":null,"html_url":"https://github.com/imDarshanGK/Functions","commit_stats":null,"previous_names":["imdarshangk/functions"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imDarshanGK%2FFunctions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imDarshanGK%2FFunctions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imDarshanGK%2FFunctions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imDarshanGK%2FFunctions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imDarshanGK","download_url":"https://codeload.github.com/imDarshanGK/Functions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243104175,"owners_count":20236943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["factorial","function-with-return-with-arguments","function-with-return-without-arguments","function-without-return-with-arguments","function-without-return-without-arguments","functional-programming","functions","python"],"created_at":"2025-03-11T19:55:59.389Z","updated_at":"2025-03-11T19:56:00.014Z","avatar_url":"https://github.com/imDarshanGK.png","language":"Python","readme":"# Python Functions 🧮\n\n## Overview 🔍\nThis repository contains Python programs demonstrating various types of functions. The projects showcase how functions can be utilized to perform tasks like calculations, data manipulation, and more. It serves as an educational resource to understand how functions work in Python.\n\n## Features 💡\n- Examples of different function types: simple, recursive, lambda functions, and more.\n- Clear, commented code for easy understanding.\n- Ideal for beginners learning Python functions.\n\n\n## Function with return with arguments\nFunction with return with arguments\n```\nprogram 1: squaare and cube\n           64\n           36\n           49\n           125\n           \nprogram 2: sum and mul and average\n          \n          x= 12 y= 48 z= 4.0\n\nprogram 3: square root and cube root and power\n\n          p= 6.0 q= 3.0 r= 16\n          \nprogram 4:sum and factorial\n\n          p= 1035 q= 230843697339241380472092742683027581083278564571807941132288000000000000\n```\n\n## Function with return without arguments\nsolution\n```\nProgram 1: Square and Cube\n\n          Enter a number to find cube:2\n          8\n          Enter a number to find square:3\n          9\n          Enter a number to find square:5\n          25\n          Enter a number to find cube:6\n          216\n          \nProgram 2: Square root and Cube root power\n\n            Enter a number:12\n            Enter a number:24\n            Enter base:3\n            Enter exponential:5\n            p= 3.4641016151377544 q= 2.8844991406148166 r= 243\n\nProgram 3: Sum and factorial\n\n          Enter a number to find sum:5\n          Enter a number to find factorial:6\n          p= 15 q= 720\n          \nProgram 4: Sum and mul and average\n\n            Enter a:12\n            Enter b:6\n            Enter c:8\n            Enter a:9\n            Enter b:7\n            Enter c:5\n            Enter a:4\n            Enter b:3\n            Enter c:1\n            x= 26 y= 315 z= 2.6666666666666665\n```\n\n## Function without return with arguments\nFunction without return with arguments.\n```\nProgram :1}cube and square\n\n           Cube= 8\n           Square= 9\n           Square= 16\n           Cube= 27\n           \nProgram :2}sum and mul and average\n        \n        sum= 14\n        sum= 14\n        product= 48\n        product= 96\n        average= 4.0\n        average= 5.666666666666667\n\nProgram :3}square root and cube root and power\n\n         square root= 6.0\n         square root= 9.0\n         cube root= 3.0\n         cube root= 3.9999999999999996\n         power= 16\n         power= 9\n\nProgram :4}sum and factorial and info\n\n         sum= 15\n         sum= 10\n         factorial= 120\n         factorial= 24\n         Name= Rakesh Age= 24 percentage= 80.33\n         Name= Ram Age= 35 percentage= 77.33\n\nProgram :5}simple interest and rectangle and circle\n\n         simple interest= 9000.0\n         simple interest= 32000.0\n         Area of rectangle= 72 perimeter= 36\n         Area of rectangle= 112 perimeter= 44\n         Area= 72.39168 circumfarence= 30.163199999999996\n         Area= 120.77848 circumfarence= 38.9608\n\nProgram :6}sum and factorial\n\n         Enter a:2\n         Enter b:3\n         sum= 3\n         sum= 6\n         Enter c:2\n         Enter d:6\n         factorial= 2\n         factorial= 720\n```\n\n## Function without return without arguments\nFunction without return without arguments.\n\nFuntions defination:\n```\nIt is the group statement this excuited when function calls.\n```\n```\nProgram 1)Good Morning\n\n            Good Morning\n            Good Afternoon\n            Good Morning\n            Good Afternoon  \n \nProgram 2:Square and cube\n\n           Enter a number to find cube:12\n           Cube= 1728\n           Enter a number to find square:10\n           Square= 100\n           Enter a number to find square:6\n           Square= 36\n           Enter a number to find cube:5\n           Cube= 125\n\n\nProgram 3:Sum and product and average\n\n           Enter a:2\n           Enter b:6\n           Enter c:83\n           sum= 91\n           \n           Enter a:9\n           Enter b:84\n           Enter c:5\n           sum= 98\n           \n           Enter a:9\n           Enter b:78\n           Enter c:2\n           product= 1404\n           \n           Enter a:1\n           Enter b:5\n           Enter c:6\n           product= 30\n           \n           Enter a:9\n           Enter b:8\n           Enter c:4\n           average= 7.0\n           \n           Enter a:9\n           Enter b:7\n           Enter c:5\n           average= 7.0\n\nProgram 4:Square root and Cube root and Power\n\n           Enter a number:8\n           square root= 2.8284271247461903\n           \n           Enter a number:6\n           square root= 2.449489742783178\n           \n           Enter a number:9\n           cube root= 2.080083823051904\n           \n           Enter a number:7\n           cube root= 1.912931182772389\n           \n           Enter base:5\n           Enter exponential:4\n           power= 625\n           \n           Enter base:3\n           Enter exponential:2\n           power= 9\n\nProgram 5:Sum and Factorial and Info\n\n           Enter a number to find sum:3\n           sum= 6\n           \n           Enter a number to find sum:8\n           sum= 36\n           \n           Enter a number to find factorial:7\n           factorial= 5040\n           \n           Enter a number to find factorial:4\n           factorial= 24\n           \n           Enter name:9\n           Enter age:5\n           Enter percentge:1.0\n           Name= 9 Age= 5 percentage= 1.0\n           \n           Enter name:6\n           Enter age:54\n           Enter percentge:9\n           Name= 6 Age= 54 percentage= 9.0\n\nProgram 6: Simple interest and Rectangle and Circle\n\n           Enter principle:5\n           Enter time:6\n           Enter rate:9\n           simple interest= 2.7\n           \n           Enter principle:7\n           Enter time:2\n           Enter rate:4\n           simple interest= 0.56\n           \n           Enter length:5\n           Enter breadth:6\n           Area of rectangle= 30 perimeter= 22\n           \n           Enter length:9\n           Enter breadth:4\n           Area of rectangle= 36 perimeter= 26\n           \n           Enter radius:5\n           Area= 78.55 circumfarence= 31.419999999999998\n           \n           Enter radius:2\n           Area= 12.568 circumfarence= 12.568\n  ```\n\n## def Factorial\ndef Factorial\n```\nExample 1:\n\nEnter a number to find factorial: 25\nfactorial= 1\nfactorial= 2\nfactorial= 6\nfactorial= 24\nfactorial= 120\nfactorial= 720\nfactorial= 5040\nfactorial= 40320\nfactorial= 362880\nfactorial= 3628800\nfactorial= 39916800\nfactorial= 479001600\nfactorial= 6227020800\nfactorial= 87178291200\nfactorial= 1307674368000\nfactorial= 20922789888000\nfactorial= 355687428096000\nfactorial= 6402373705728000\nfactorial= 121645100408832000\nfactorial= 2432902008176640000\nfactorial= 51090942171709440000\nfactorial= 1124000727777607680000\nfactorial= 25852016738884976640000\nfactorial= 620448401733239439360000\nfactorial= 15511210043330985984000000\n\nEnter a number to find factorial: 10\nfactorial= 1\nfactorial= 2\nfactorial= 6\nfactorial= 24\nfactorial= 120\nfactorial= 720\nfactorial= 5040\nfactorial= 40320\nfactorial= 362880\nfactorial= 3628800\n\nEnter a number to find factorial: 5\nfactorial= 1\nfactorial= 2\nfactorial= 6\nfactorial= 24\nfactorial= 120\n\nExample 2:\n\nEnter a number to find factorial: 5\nfactorial= 1\nfactorial= 2\nfactorial= 6\nfactorial= 24\nfactorial= 120\n\nEnter a number to find factorial: 4\nfactorial= 1\nfactorial= 2\nfactorial= 6\nfactorial= 24\n\nEnter a number to find factorial: 3\nfactorial= 1\nfactorial= 2\nfactorial= 6\n```\n\n## Factorial of n using recursive function\nFactorial of n using recursive function\n```\nExplanation  :   \nfactorial(7)\n7*factorial(6)=5040\n   720*7\n6*factorial(5)=720\n   120*6\n5*factorial(4)=120\n   24*5\n4*factorial(3)=24\n   6*4\n3*factorial(2)=6\n   2*1\n2*factorial(1)=2\n\noutput:\n    Result= 5040\n```\n\n## Finding power using recursive function\nFinding power using recursive function \n```\noutput:\n   result= 1024\n\n Explanation:  \npower(4,5)=1024\n   256*4\n4*power(4,4)=256\n   64*4\n4*power(4,3)=64\n   16*4\n4*power(4,2)=16\n   4*4\n4*power(4,1)=4\n   4*1\n```\n\n## Recursive Function sum of n integers using recursive function\n```\nsum of n integers using recursive function\ndef Function which calls itself repetedly till stopping condition occurs.\nsum of n integers using recursive function.\n```\n## Recursive Function:\n```\nFunction which calls itself repetedly till stopping condition occurs.\n```\n```\noutput:\n   result= 21\n```\n## square and cube\nsquare and cube\n```\noutput:\n27\n4\n9\n64\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimdarshangk%2Ffunctions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimdarshangk%2Ffunctions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimdarshangk%2Ffunctions/lists"}