This repository contains multiple Python tasks covering file handling, data processing, system information retrieval, and API integration.
- Goal: Create a script that:
- Accepts a file name as input.
- Outputs the file's extension.
- Raises an exception if no extension exists.
- Goal: Given a list of integers:
- Remove duplicates.
- Convert the resulting list to a tuple.
- Find the minimum and maximum numbers.
- Goal: Create a script that:
- Reads an access log from a file (file name provided as argument).
- Outputs:
- Total number of unique User Agents.
- Statistics with the number of requests per User Agent.
- Note: Example
access.log
file link provided.
- Goal: Given an input string, count the occurrences of all characters.
- Example:
pythonnohtyppy → p:3, y:3, t:2, h:2, o:2, n:2
.
- Example:
- Goal: Write a script that retrieves system information:
- Distro info
- Memory: total, used, free
- CPU info: model, core numbers, speed
- Current user
- System load average
- IP address
- Arguments:
-d
→ Distro info-m
→ Memory info-c
→ CPU info-u
→ User info-l
→ Load average-i
→ IP address
Create a script that integrates with Survey Monkey to create a survey.
- Sign up at Survey Monkey.
- Create a draft application at Survey Monkey Developer.
- Obtain an ACCESS_TOKEN for making API requests.
- Set the required permissions for the application.
- The script should:
- Accept a JSON file with survey questions.
- Accept a text file with a list of email addresses.
- JSON file structure example:
- Note: Email sending didn’t work because that feature requires a paid SurveyMonkey account. However, the survey can still be shared via the free weblink collector: https://www.surveymonkey.com/r/FXXK69M
{
"Survey_Name": {
"Page_Name": {
"Question1_Name": {
"Description": "Description of question",
"Answers": [
"Answer1",
"Answer2",
"Answer3"
]
},
"Question2_Name": {
"Description": "Description of question",
"Answers": [
"Answer1",
"Answer2",
"Answer3"
]
}
}
}
}