Skip to content

Add files via upload#1

Open
DuskForged-Coder wants to merge 1 commit intomainfrom
Aditay-Narayan-Assignment-1-task-1-and-2
Open

Add files via upload#1
DuskForged-Coder wants to merge 1 commit intomainfrom
Aditay-Narayan-Assignment-1-task-1-and-2

Conversation

@DuskForged-Coder
Copy link
Owner

📃Assignment 1📃
📄Task1

This Python program allows the user to perform basic arithmetic calculations on two numbers:

The user is prompted to enter two numbers: a and b.

It then calculates and displays:

Addition of a and b

Subtraction of b from a

Multiplication of a and b

Division of a by b

The program uses Python’s built-in arithmetic operators (+, -, *, /) and the input() function to take user input, converting the input to integers using int().

📃Assignment 1📃
📄Task2

This Python program is designed to interactively collect and display a user’s full name with a custom greeting.

🔹 Functionality:
The program first prompts the user to enter their first name using input().

Then it asks for the middle name. If the user doesn't enter anything and simply presses Enter:

The program prints: ["No middle name entered."]

Otherwise, it prints the middle name entered by the user.

Next, the program prompts the user to enter their last name.

Finally, it displays a friendly greeting that includes the full name:

If a middle name was entered, it shows:
["Hello ! Welcome to the Python program."]

If the middle name is left blank, the greeting still works properly.

🔹 Concepts Used:
->[input()] for user interaction

->[if-else] conditional statements

->String concatenation and printing

📃Assignment 1📃
📄Task1

This Python program allows the user to perform basic arithmetic calculations on two numbers:

The user is prompted to enter two numbers: a and b.

It then calculates and displays:

Addition of a and b

Subtraction of b from a

Multiplication of a and b

Division of a by b

The program uses Python’s built-in arithmetic operators (+, -, *, /) and the input() function to take user input, converting the input to integers using int().

📃Assignment 1📃
📄Task2

This Python program is designed to interactively collect and display a user’s full name with a custom greeting.

🔹 Functionality:
The program first prompts the user to enter their first name using input().

Then it asks for the middle name. If the user doesn't enter anything and simply presses Enter:

The program prints: ["No middle name entered."]

Otherwise, it prints the middle name entered by the user.

Next, the program prompts the user to enter their last name.

Finally, it displays a friendly greeting that includes the full name:

If a middle name was entered, it shows:
["Hello <first> <middle> <last>! Welcome to the Python program."]

If the middle name is left blank, the greeting still works properly.

🔹 Concepts Used:
->[input()] for user interaction

->[if-else] conditional statements

->String concatenation and printing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant