Skip to content

Commit a1ca0b1

Browse files
committed
intro to datatype assignment & files created
1 parent a593289 commit a1ca0b1

File tree

6 files changed

+38
-0
lines changed

6 files changed

+38
-0
lines changed
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
### Data Types Theory
3+
4+
1. Write a Python program that accepts different types of inputs (integer, float, string,Boolean) from the user and displays the data type of each input.
5+
6+
2. Write a program that reads a user input and checks whether it's a valid integer, float, or string. Print an appropriate message for each case.
7+
8+
### Immutable & Mutable
9+
10+
1. Write a Python program to demonstrate immutability by attempting to modify a string after creation. Catch any errors and print an explanation.
11+
12+
2. Write a program to create a list and modify it by adding and removing elements. Show how the list changes with each operation.
13+
14+
15+
### Numbers
16+
17+
1. Write a Python program to perform arithmetic operations (addition, subtraction, multiplication, division, floor division, and modulus) on two numbers provided by the user.
18+
19+
2. Create a Python program to generate and print a random number between 1 and 100. Use the `random` module.
20+
21+
3. Write a Python program to calculate the square root of a given number. Use the `math` module and handle non-positive inputs appropriately.
22+
23+
4. Write a program to accept a floating-point number from the user and round it to 2 decimal places. Print both the original and rounded values.
24+
25+
5. Create a program that converts a user input from degrees Celsius to Fahrenheit and vice versa.
26+
27+
### Strings
28+
29+
1. Write a Python program to input a string from the user and count how many vowels and consonants are in the string.
30+
31+
2. Create a Python program that accepts a sentence from the user and reverses the order of the words in the sentence.
32+
33+
3. Write a Python program to remove all occurrences of a specific character from a string provided by the user.
34+
35+
4. Write a Python program to check if two strings are anagrams of each other (contain the same characters in a different order).
36+
37+
5. Write a Python program to capitalize the first letter of each word in a sentence without using the `title()` method.
38+

Intro_To_Datatypes/Assignment/Solutions.md

Whitespace-only changes.

Intro_To_Datatypes/Boolean.py

Whitespace-only changes.

Intro_To_Datatypes/Numbers.py

Whitespace-only changes.

Intro_To_Datatypes/String.py

Whitespace-only changes.

Intro_To_Datatypes/Types_of_datatype.py

Whitespace-only changes.

0 commit comments

Comments
 (0)