Skip to content

grimmjowESP6/assignments

Repository files navigation

Assignments

This is the Assignments submission repos

Assignment - 1

asst-1.1.py file contains the solution for the first task

  • Takes two numbers as input from the user.
  • Performs basic mathematical operations to these two numbers.
  • Displays the results of each operation on the screen.

asst-1.2.py file contains the solution for the second task

  • Takes a user's first and last names as the input.
  • Concatenates the first and last names into a full name.
  • Prints a personalized greeting message using the full name.

Assignment - 2

asst-2.1.py file contains the solution for the first task

  • Takes an integer input from the user.
  • Checks whether the number is even or odd using an if-else statement.
  • Displays the result accordingly.

asst-2.2.py file contains the solution for the second task

  • Uses a for loop to iterate over numbers from 1 to 50.
  • Calculates the sum of all integers in this range.
  • Displays the final sum.

Assignment - 3

asst-3.1.py file contains the solution for the first task

  • Defines a function named factorial that takes a number as an argument and calculates its factorial using a loop or recursion.
  • Returns the calculated factorial.
  • Calls the function with a sample number and prints the output.

asst-3.2.py file contains the solution for the second task

  • Asks the user for a number as input.
  • Uses the math module to calculate.
  • Displays the calculated results.

Assignment - 4

asst-4.1.py file contains the solution for the first task

  • Opens and reads a text file named sample.txt.
  • Prints its content line by line.
  • Handles errors gracefully if the file does not exist.

asst-4.2.py file contains the solution for the second task

  • Takes user input and writes it to a file named output.txt.
  • Appends additional data to the same file.
  • Reads and displays the final content of the file.

About

Assignments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages