{"id":20713389,"url":"https://github.com/roshan-khandagale/python-programs","last_synced_at":"2025-03-11T06:43:48.480Z","repository":{"id":253565155,"uuid":"843880359","full_name":"ROSHAN-KHANDAGALE/Python-Programs","owner":"ROSHAN-KHANDAGALE","description":"Here is an Basic Python Practice Repository containing solutions for Questions available on given link below","archived":false,"fork":false,"pushed_at":"2024-08-20T18:03:01.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T21:30:34.804Z","etag":null,"topics":["functions-python","practice-programming","python","python-conditionalstatements","python-libraries","python-script","w3resource"],"latest_commit_sha":null,"homepage":"https://www.w3resource.com/python-exercises/python-basic-exercises.php","language":null,"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/ROSHAN-KHANDAGALE.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":"2024-08-17T17:43:48.000Z","updated_at":"2024-08-20T18:03:04.000Z","dependencies_parsed_at":"2024-08-20T20:08:42.716Z","dependency_job_id":null,"html_url":"https://github.com/ROSHAN-KHANDAGALE/Python-Programs","commit_stats":null,"previous_names":["roshan-khandagale/python_practice"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROSHAN-KHANDAGALE%2FPython-Programs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROSHAN-KHANDAGALE%2FPython-Programs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROSHAN-KHANDAGALE%2FPython-Programs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ROSHAN-KHANDAGALE%2FPython-Programs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ROSHAN-KHANDAGALE","download_url":"https://codeload.github.com/ROSHAN-KHANDAGALE/Python-Programs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242988012,"owners_count":20217534,"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":["functions-python","practice-programming","python","python-conditionalstatements","python-libraries","python-script","w3resource"],"created_at":"2024-11-17T02:25:04.069Z","updated_at":"2025-03-11T06:43:48.427Z","avatar_url":"https://github.com/ROSHAN-KHANDAGALE.png","language":null,"readme":"# W3Resources (Basic Python Part - I)\n### 1. Write a Python program to print the following string in a specific format (see the output).\n### Sample String : \"Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond in the sky. Twinkle, twinkle, little star, How I wonder what you are\"\n\n### Output :\n```\nTwinkle, twinkle, little star,\n\tHow I wonder what you are! \n\t\tUp above the world so high,   \t\t\n\t\tLike a diamond in the sky. \nTwinkle, twinkle, little star, \n\tHow I wonder what you are\n```\n### Code\n```\nprint(\"Twinkle, twinkle, little star,\")\nprint(\"\t       How I wonder what you are! \")\nprint(\"\t\t         Up above the world so high,\")\nprint(\"\t\t         Like a diamond in the sky.\")\nprint(\"Twinkle, twinkle, little star,\")\nprint(\" \t   How I wonder what you are\")\n```\n\n### 2. Write a Python program to find out what version of Python you are using.\n### Code\n\n```\nimport sys\nprint(\"Python Version: \", sys.version)\n```\n\n### 3. Write a Python program to display the current date and time.\n### Sample Output :\n```\nCurrent date and time :\n2014-07-05 14:34:14\n```\n### Code\n```\nimport datetime\nprint(\"Current Date and Time: \", datetime.datetime.now())\n```\n\n### 4. Write a Python program that calculates the area of a circle based on the radius entered by the user.\n```\nSample Output :\nr = 1.1\nArea = 3.8013271108436504\n```\n### Code\n```\nprint(\"Area of Circle Program!!\")\nradius = float(input(\"Input Radius: \"))\narea_of_circle = (22/7) * radius ** 2\nprint(\"Area of Circle = \", area_of_circle)\n```\n\n### 5. Write a Python program that accepts the user's first and last name and prints them in reverse order with a space between them.\n### Code\n```\nfirst_name = input(\"Input First Name: \")\nlast_name = input(\"Input last name: \")\nprint(last_name, first_name)\n```\n\n### 6. Write a Python program that accepts a sequence of comma-separated numbers from the user and generates a list and a tuple of those numbers.\n## Sample data : 3, 5, 7, 23\n```\nOutput :\nList : ['3', ' 5', ' 7', ' 23']\nTuple : ('3', ' 5', ' 7', ' 23')\n```\n### Code\n```\nvalues = input(\"Input some values followed by commans: \")\nlist_value = values.split(\",\")\nprint(List: list_value)\nprint(Tuple: tuple(list_value))\n```\n\n### 7. Write a Python program that accepts a filename from the user and prints the extension of the file.\n### Sample filename : abc.java\n```\nOutput : java\n```\n### Code\n```\nfile_name = input(\"Enter file name with its extension: \")\next_split = file_name.split(\".\")\nprint(\"File Extension is:\", ext_split[-1])\n```\n\n### 8. Write a Python program to display the first and last colors from the following list.\n### Sample data: color_list = [\"Red\",\"Green\",\"White\" ,\"Black\"]\n### Code\n```\ncolor_list = [\"Red\", \"Green\", \"White\", \"Black\"]\nprint(color_list[0], color_list[-1])\n```\n\n### 9. Write a Python program to display the examination schedule. (extract the date from exam_st_date).\n### Sample Input: exam_st_date = (11, 12, 2014)\n```\nSample Output : The examination will start from : 11 / 12 / 2014\n```\n### Code\n```\nexam_st_date = (11, 12, 2014)\nprint(\"The examination will start from: \", exam_st_date[0], \"/\", exam_st_date[1], \"/\", exam_st_date[2])\n```\n\n### 10. Write a Python program that accepts an integer (n) and computes the value of n+nn+nnn.\n### Sample value of n is 5\n### Expected Result : 615\n### Code\n```\nn = int(input(\"Enter n value: \"))\nn1 = int(\"%s\" % n)\nn2 = int(\"%s%s\" % (n, n))\nn3 = int(\"%s%s%s\" % (n, n, n))\nprint(n1 + n2 + n3)\n```\n\n### 11. Write a Python program to print the documents (syntax, description etc.) of Python built-in function(s).\n### Sample function : abs()\n```\nExpected Result :\nabs(number) -\u003e number\nReturn the absolute value of the argument.\n```\n\n### 12. Write a Python program that prints the calendar for a given month and year.\n#### Note : Use 'calendar' module.\n### Code\n```chatinput\nimport calendar\n\nmonth = int(input(\"Enter month: \"))\nyear = int(input(\"Enter Year: \"))\ncal = calendar.month(year, month)\nprint(cal)\n```\n\n### 13. Write a Python program to print the following 'here document'.\n### Sample string : \n```\na string that you \"don't\" have to escape\nThis\nis a ....... multi-line\nheredoc string --------\u003e example\n```\n\n### 14. Write a Python program to calculate the number of days between two dates.\n### Sample dates : (2014, 7, 2), (2014, 7, 11)\n### Expected output : 9 days\n### Code\n```chatinput\nfrom datetime import date\n\ndate1 = date(2014, 7, 29)\ndate2 = date(2014, 8, 3)\nprint(\"Remaining days: \", abs(date1 - date2))\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froshan-khandagale%2Fpython-programs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froshan-khandagale%2Fpython-programs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froshan-khandagale%2Fpython-programs/lists"}