Join the conversation
print(type(x))
print(type(y))
print(type(r))
print(type(c))
print(type(f))
Reply
dilep main " coma nahi dala
Reply
# String: A sequence of characters enclosed in quotes.
string_example = "Hello, World!"# Integer: A whole number, positive or negative, without decimals.
integer_example = 42# Tuple: An immutable sequence of elements, defined by parentheses.
tuple_example = (1, 2, 3, 4)# Dictionary: A collection of key-value pairs, defined by curly braces.
dictionary_example = {
"name": "Alice",
"age": 30,
"city": "New York"
}# Set: An unordered collection of unique elements, defined by curly braces.
set_example = {1, 2, 3, 4, 5}
Reply
Int: An integer, a whole number without a fractional part, such as 99, 100, 105
Float: A floating-point number, a number that includes a decimal point, such as 99.5, 100.0, 105.25
String: A sequence of characters enclosed in quotes, such as "hello", "123", "Python"
List of string: A collection of strings, enclosed in square brackets, such as ["apple", "banana", "cherry"]
Tuple: An ordered, immutable collection of elements, enclosed in parentheses, such as (1, 2, 3) or ("a", "b", "c")
Dictionary: A collection of key-value pairs, enclosed in curly braces, such as {"name": "Alice", "age": 25}
Set: An unordered collection of unique elements, enclosed in curly braces, such as {1, 2, 3} or {"apple", "banana", "cherry"}
Reply
int stand for integer is a whole number (not a fractional number) that can be positive, negative, or zero. Examples of integers are: -5, 1, 5, 8, 97. A list of integers a collection of distinct types of values or items. The elements in the list are separated by using commas (,) and are surrounded by square brackets [] . For Example : (1,2,3,4 ). A float point number, is a positive or negative whole number with a decimal point. For example, 5.5, 0.25, and -103.342. String is a collection of alphabets, words or other characters. For example: "Hello World" List of String : First use square brackets [ and ] to create a list. Then place the list items inside the brackets separated by commas. For example: ["Hello world", "Codanics" ]. A tuple is an ordered sequence of elements of different data types, such as integer, float, string, list or even a tuple. A dictionaries are mutable data structures that allow you to store key-value pairs. SET can hold one or more of the values declared for its data type .
Reply
"int" mean integer = whole number
"float" mean floating point values = decimal numbers
Reply
The term "int" typically refers to the data type "integer" in computer programming. An integer is a whole number that does not have a fractional or decimal part. In various programming languages, including C, C++, Java, and others, "int" is a keyword used to declare a variable as an integer type.The keyword "float" is often used to declare variables that store floating-point values. For example, in C or C++:The keyword "float" is often used to declare variables that store floating-point values. For example, in C or C++:Language and Words:A dictionary is a reference book or online resource that provides definitions, explanations, and sometimes translations of words. It typically includes information about the pronunciation, origin, usage, and grammatical details of words. Dictionaries are important tools for individuals learning a language or seeking clarification on the meanings of words.
Data Structure in Computer Science:In computer science, a dictionary (or map, associative array, or hash table in some programming languages) is a data structure that stores key-value pairs. Each key is associated with a corresponding value, and the dictionary allows efficient retrieval of the value using the key. Dictionaries are widely used in programming for tasks like data storage, indexing, and quick retrieval of information.c
Reply
int:Stands for integer.
Represents whole numbers without any decimal points.
Example: x = 5
float:Stands for floating-point.
Represents numbers with decimal points.
Example: y = 3.14
string:Represents a sequence of characters.
Enclosed in single (') or double (") quotes.
Example: text = "Hello, World!"
list:An ordered and mutable collection of elements.
Elements can be of any data type, including other lists.
Enclosed in square brackets ([]).
Example: my_list = [1, 2, 3, "four", 5.0]
list of int:A list containing elements of type int.
Example: int_list = [1, 2, 3, 4, 5]
list of string:A list containing elements of type string.
Example: str_list = ["apple", "banana", "cherry"]
dictionary:An unordered collection of key-value pairs.
Keys must be unique, and they are used to access values.
Enclosed in curly braces ({}).
Example: my_dict = {"name": "John", "age": 25, "city": "New York"}
set:An unordered and unindexed collection of unique elements.
Enclosed in curly braces ({}).
Example: my_set = {1, 2, 3, 4, 5}
Reply
inverted comas r missed
saima is also wrong
Reply
Numeric Types:int: Integer type (e.g., 10, -3, 42)
float: Floating-point type (e.g., 3.14, -0.5, 2.0)
Sequence Types:str: String type (e.g., "Hello, World!", 'Python')
list: List type (e.g., [1, 2, 3], ['apple', 'orange'])
tuple: Tuple type (e.g., (1, 2, 3), ('a', 'b'))
Set Types:set: Unordered collection of unique elements (e.g., {1, 2, 3}, {'apple', 'orange'})
Mapping Type:dict: Dictionary type (e.g., {'key1': 'value1', 'key2': 'value2'})
Boolean Type:bool: Boolean type (True or False)
None Type:NoneType: Represents the absence of a value (e.g., None)
Binary Types:bytes: Immutable sequence of bytes (e.g., b'hello')
bytearray: Mutable sequence of bytes (e.g., bytearray(b'hello'))
memoryview: A view object that exposes an array’s buffer interface (e.g., memoryview(b'hello'))
Other Numeric Types:complex: Complex number type (e.g., 3 + 4j)
Reply