python for intermidiet Object-Oriented Programming (OOP)
Object-oriented programming (OOP) is a programming paradigm that organizes software around data, or objects, rather than functions and procedures. In OOP, objects are self-contained entities that encapsulate data (attributes) and behavior (methods). They can communicate with each other through a well-defined interface.
Key Concepts in OOP
Class: A class is a blueprint for creating objects. It defines the attributes and methods that all objects of that class will have.
Object: An object is an instance of a class. It represents a specific entity in the real world, such as a person, a dog, or a car.
Instantiation: The process of creating an object from a class is called instantiation.
Inheritance: Inheritance allows classes to inherit attributes and methods from other classes. This enables code reuse and promotes code maintainability.
Encapsulation: Encapsulation is the process of hiding the internal implementation details of an object and exposing only the necessary methods to interact with it. This promotes modularity and protects data integrity.
Benefits of OOP
Modular Code: OOP promotes code modularity by breaking down complex programs into smaller, manageable units called classes.
Reusability: OOP allows for code reuse through inheritance and polymorphism, making development more efficient and cost-effective.
Maintainability: OOP code is easier to maintain and modify due to its modular structure and well-defined interfaces.
Scalability: OOP makes it easier to develop scalable and extensible applications, as new classes can be easily added or modified without affecting existing code.
Creating an Object from a Class
To create an object from a class, use the following syntax:
Python
object_name = ClassName(argument1, argument2, ...)
Use code with caution. Learn more
Where:
object_name is the name of the object you are creating
ClassName is the name of the class you are using to create the object
argument1, argument2, ... are the arguments required by the init() method of the class
Accessing Attributes and Calling Methods
To access an attribute of an object, use the following syntax:
Python
object_name.attribute_name
Use code with caution. Learn more
Where:
object_name is the name of the object
attribute_name is the name of the attribute
To call a method of an object, use the following syntax:
Python
object_name.method_name(argument1, argument2, ...)
Use code with caution. Learn more
Where:
object_name is the name of the object
method_name is the name of the method
argument1, argument2, ... are the arguments required by the method
Example: Modeling a Dog
Let's create a simple class called Dog to model a dog:
Python
class
Dog:
def
init(self, name, age):
self.name = name
self.age = age
def
sit(self):
print(f"{self.name} is sitting.")
def
roll_over(self):
print(f"{self.name} rolled over!")
Use code with caution. Learn more
To create a Dog object, use the following code:
Python
my_dog = Dog('Willie', 6)
Use code with caution. Learn more
Now you can interact with the Dog object using its attributes and methods:
Python
print(my_dog.name) # Output: Willie
my_dog.sit() # Output: Willie is sitting.
my_dog.roll_over() # Output: Willie rolled over!
Use code with caution. Learn more
Object-oriented programming (OOP) is a programming paradigm that organizes software around data, or objects, rather than functions and procedures. In OOP, objects are self-contained entities that encapsulate data (attributes) and behavior (methods). They can communicate with each other through a well-defined interface.
Key Concepts in OOP
Class: A class is a blueprint for creating objects. It defines the attributes and methods that all objects of that class will have.
Object: An object is an instance of a class. It represents a specific entity in the real world, such as a person, a dog, or a car.
Instantiation: The process of creating an object from a class is called instantiation.
Inheritance: Inheritance allows classes to inherit attributes and methods from other classes. This enables code reuse and promotes code maintainability.
Encapsulation: Encapsulation is the process of hiding the internal implementation details of an object and exposing only the necessary methods to interact with it. This promotes modularity and protects data integrity.
Benefits of OOP
Modular Code: OOP promotes code modularity by breaking down complex programs into smaller, manageable units called classes.
Reusability: OOP allows for code reuse through inheritance and polymorphism, making development more efficient and cost-effective.
Maintainability: OOP code is easier to maintain and modify due to its modular structure and well-defined interfaces.
Scalability: OOP makes it easier to develop scalable and extensible applications, as new classes can be easily added or modified without affecting existing code.
Creating an Object from a Class
To create an object from a class, use the following syntax:
Python
object_name = ClassName(argument1, argument2, ...)
Use code with caution. Learn more
Where:
object_name is the name of the object you are creating
ClassName is the name of the class you are using to create the object
argument1, argument2, ... are the arguments required by the init() method of the class
Accessing Attributes and Calling Methods
To access an attribute of an object, use the following syntax:
Python
object_name.attribute_name
Use code with caution. Learn more
Where:
object_name is the name of the object
attribute_name is the name of the attribute
To call a method of an object, use the following syntax:
Python
object_name.method_name(argument1, argument2, ...)
Use code with caution. Learn more
Where:
object_name is the name of the object
method_name is the name of the method
argument1, argument2, ... are the arguments required by the method
Example: Modeling a Dog
Let's create a simple class called Dog to model a dog:
Python
class
Dog:
def
init(self, name, age):
self.name = name
self.age = age
def
sit(self):
print(f"{self.name} is sitting.")
def
roll_over(self):
print(f"{self.name} rolled over!")
Use code with caution. Learn more
To create a Dog object, use the following code:
Python
my_dog = Dog('Willie', 6)
Use code with caution. Learn more
Now you can interact with the Dog object using its attributes and methods:
Python
print(my_dog.name) # Output: Willie
my_dog.sit() # Output: Willie is sitting.
my_dog.roll_over() # Output: Willie rolled over!
Use code with caution. Learn more
Object-Oriented Programming (OOP)
Object-oriented programming (OOP) is a programming paradigm that organizes software around data, or objects, rather than functions and procedures. In OOP, objects are self-contained entities that encapsulate data (attributes) and behavior (methods). They can communicate with each other through a well-defined interface.
Key Concepts in OOP
Class: A class is a blueprint for creating objects. It defines the attributes and methods that all objects of that class will have.
Object: An object is an instance of a class. It represents a specific entity in the real world, such as a person, a dog, or a car.
Instantiation: The process of creating an object from a class is called instantiation.
Inheritance: Inheritance allows classes to inherit attributes and methods from other classes. This enables code reuse and promotes code maintainability.
Encapsulation: Encapsulation is the process of hiding the internal implementation details of an object and exposing only the necessary methods to interact with it. This promotes modularity and protects data integrity.
Benefits of OOP
Modular Code: OOP promotes code modularity by breaking down complex programs into smaller, manageable units called classes.
Reusability: OOP allows for code reuse through inheritance and polymorphism, making development more efficient and cost-effective.
Maintainability: OOP code is easier to maintain and modify due to its modular structure and well-defined interfaces.
Scalability: OOP makes it easier to develop scalable and extensible applications, as new classes can be easily added or modified without affecting existing code.
Creating an Object from a Class
To create an object from a class, use the following syntax:
Python
object_name = ClassName(argument1, argument2, ...)
Use code with caution. Learn more
Where:
object_name is the name of the object you are creating
ClassName is the name of the class you are using to create the object
argument1, argument2, ... are the arguments required by the init() method of the class
Accessing Attributes and Calling Methods
To access an attribute of an object, use the following syntax:
Python
object_name.attribute_name
Use code with caution. Learn more
Where:
object_name is the name of the object
attribute_name is the name of the attribute
To call a method of an object, use the following syntax:
Python
object_name.method_name(argument1, argument2, ...)
Use code with caution. Learn more
Where:
object_name is the name of the object
method_name is the name of the method
argument1, argument2, ... are the arguments required by the method
Example: Modeling a Dog
Let's create a simple class called Dog to model a dog:
Python
class
Dog:
def
init(self, name, age):
self.name = name
self.age = age
def
sit(self):
print(f"{self.name} is sitting.")
def
roll_over(self):
print(f"{self.name} rolled over!")
Use code with caution. Learn more
To create a Dog object, use the following code:
Python
my_dog = Dog('Willie', 6)
Use code with caution. Learn more
Now you can interact with the Dog object using its attributes and methods:
Python
print(my_dog.name) # Output: Willie
my_dog.sit() # Output: Willie is sitting.
my_dog.roll_over() # Output: Willie rolled over!
Use code with caution. Learn more
Conclusion
Object-oriented programming (OOP) is a programming paradigm that organizes software around data, or objects, rather than functions and procedures. In OOP, objects are self-contained entities that encapsulate data (attributes) and behavior (methods). They can communicate with each other through a well-defined interface.
Key Concepts in OOP
Class: A class is a blueprint for creating objects. It defines the attributes and methods that all objects of that class will have.
Object: An object is an instance of a class. It represents a specific entity in the real world, such as a person, a dog, or a car.
Instantiation: The process of creating an object from a class is called instantiation.
Inheritance: Inheritance allows classes to inherit attributes and methods from other classes. This enables code reuse and promotes code maintainability.
Encapsulation: Encapsulation is the process of hiding the internal implementation details of an object and exposing only the necessary methods to interact with it. This promotes modularity and protects data integrity.
Benefits of OOP
Modular Code: OOP promotes code modularity by breaking down complex programs into smaller, manageable units called classes.
Reusability: OOP allows for code reuse through inheritance and polymorphism, making development more efficient and cost-effective.
Maintainability: OOP code is easier to maintain and modify due to its modular structure and well-defined interfaces.
Scalability: OOP makes it easier to develop scalable and extensible applications, as new classes can be easily added or modified without affecting existing code.
Creating an Object from a Class
To create an object from a class, use the following syntax:
Python
object_name = ClassName(argument1, argument2, ...)
Use code with caution. Learn more
Where:
object_name is the name of the object you are creating
ClassName is the name of the class you are using to create the object
argument1, argument2, ... are the arguments required by the init() method of the class
Accessing Attributes and Calling Methods
To access an attribute of an object, use the following syntax:
Python
object_name.attribute_name
Use code with caution. Learn more
Where:
object_name is the name of the object
attribute_name is the name of the attribute
To call a method of an object, use the following syntax:
Python
object_name.method_name(argument1, argument2, ...)
Use code with caution. Learn more
Where:
object_name is the name of the object
method_name is the name of the method
argument1, argument2, ... are the arguments required by the method
Example: Modeling a Dog
Let's create a simple class called Dog to model a dog:
Python
class
Dog:
def
init(self, name, age):
self.name = name
self.age = age
def
sit(self):
print(f"{self.name} is sitting.")
def
roll_over(self):
print(f"{self.name} rolled over!")
Use code with caution. Learn more
To create a Dog object, use the following code:
Python
my_dog = Dog('Willie', 6)
Use code with caution. Learn more
Now you can interact with the Dog object using its attributes and methods:
Python
print(my_dog.name) # Output: Willie
my_dog.sit() # Output: Willie is sitting.
my_dog.roll_over() # Output: Willie rolled over!
Use code with caution. Learn more
Conclusion
👍3
try this one Design an OOP solution to represent a library system, including books, authors, and members.
Strings: The Storytellers of Python
Welcome back, young Python adventurers! Today, we unleash the power of strings, the storytellers of the coding world. They hold words, sentences, and even entire narratives, waiting to be crafted into your programs. Buckle up, because we're about to dive into their fascinating world!
Imagine strings as magic boxes brimming with characters: letters, numbers, symbols, even spaces! Anything enclosed in quotes, like "Hello, world!" or 'My name is Addis,' becomes a powerful string. You can use single or double quotes, whichever tickles your coding fancy.
But what can these strings do? Oh, their powers are endless! Let's see some tricks:
1. Case Chameleon:
.upper(): Unleash your inner superhero and make every letter uppercase. Watch "python" transform into "PYTHON"!
.lower(): Shhh, whisper like a secret agent with lowercase letters. Turn "HELLO" into a stealthy "hello."
.noscript(): Feel like writing a fancy story? Use .noscript() to capitalize the first letter of each word and make your sentences shine. "my favorite food is..." becomes "My Favorite Food Is..."
2. Master of Disguise:
F-strings: These are powerful spells that let you weave variables into your strings. Imagine having a variable called friend_name with the value "Meklit." You can write f"Hey, {friend_name}!" and see "Hey, Meklit!" appear on the screen like magic.
3. Combining Forces:
Strings are like friendly neighbors who love playing together. You can join them with a simple + sign. Watch "My" and "computer" become "My computer" with just one +.
Welcome back, young Python adventurers! Today, we unleash the power of strings, the storytellers of the coding world. They hold words, sentences, and even entire narratives, waiting to be crafted into your programs. Buckle up, because we're about to dive into their fascinating world!
Imagine strings as magic boxes brimming with characters: letters, numbers, symbols, even spaces! Anything enclosed in quotes, like "Hello, world!" or 'My name is Addis,' becomes a powerful string. You can use single or double quotes, whichever tickles your coding fancy.
But what can these strings do? Oh, their powers are endless! Let's see some tricks:
1. Case Chameleon:
.upper(): Unleash your inner superhero and make every letter uppercase. Watch "python" transform into "PYTHON"!
.lower(): Shhh, whisper like a secret agent with lowercase letters. Turn "HELLO" into a stealthy "hello."
.noscript(): Feel like writing a fancy story? Use .noscript() to capitalize the first letter of each word and make your sentences shine. "my favorite food is..." becomes "My Favorite Food Is..."
2. Master of Disguise:
F-strings: These are powerful spells that let you weave variables into your strings. Imagine having a variable called friend_name with the value "Meklit." You can write f"Hey, {friend_name}!" and see "Hey, Meklit!" appear on the screen like magic.
3. Combining Forces:
Strings are like friendly neighbors who love playing together. You can join them with a simple + sign. Watch "My" and "computer" become "My computer" with just one +.
Examples
Print "hello world!" in uppercase: "hello world!".upper() will output "HELLO WORLD!"
Print "MY COMPUTER IS AWESOME" in lowercase: "MY COMPUTER IS AWESOME".lower() will output "my computer is awesome"
Use .noscript() to write a sentence: "my favorite language is python" becomes "My Favorite Language Is Python"
Print "hello world!" in uppercase: "hello world!".upper() will output "HELLO WORLD!"
Print "MY COMPUTER IS AWESOME" in lowercase: "MY COMPUTER IS AWESOME".lower() will output "my computer is awesome"
Use .noscript() to write a sentence: "my favorite language is python" becomes "My Favorite Language Is Python"
👍1
''ready to be come a web development wizard''
Habesha web acadamy
web development ለመማር ከፈለጉ ወደ habesha web acadamey ይምጡ እና አቅምዎን ያሳዩ።
ልምድ ያላቸው አስጠኚዎች ከመሰረታዊው HTML እና CSS ጀምሮ እስከ ላቀው JAVA SCRIPT እና ሌሎችንም የድህረ ገፅ እውቀቶች ያገኛሉ።
ሙሉ ለ ሙሉ ጀማሪ ከሆኑ ወይም አዲስ coder ከሆኑ ይሄ ትምህርት ለናንተ ነው።
ይሄ tutor ችሎታችሁን ከተወዳዳሪ በላይ ለማድረግ ለምትፈልጉ ወሳኝ ነው።
don't miss out on this opportunity to become a coding maestro- enroll in habesha web Acadamey Telegram tutoring session today.
ትምህርቱ የሚሰጠው በ አማርኛ ነው🇪🇹
ዋጋው ተመጣጣኝ ነው።
ለመመዝገብ👇👇
@habesha_web_academy_bot
@habesha_web_academy_bot
@habesha_web_academy_bot
Habesha web acadamy
web development ለመማር ከፈለጉ ወደ habesha web acadamey ይምጡ እና አቅምዎን ያሳዩ።
ልምድ ያላቸው አስጠኚዎች ከመሰረታዊው HTML እና CSS ጀምሮ እስከ ላቀው JAVA SCRIPT እና ሌሎችንም የድህረ ገፅ እውቀቶች ያገኛሉ።
ሙሉ ለ ሙሉ ጀማሪ ከሆኑ ወይም አዲስ coder ከሆኑ ይሄ ትምህርት ለናንተ ነው።
ይሄ tutor ችሎታችሁን ከተወዳዳሪ በላይ ለማድረግ ለምትፈልጉ ወሳኝ ነው።
don't miss out on this opportunity to become a coding maestro- enroll in habesha web Acadamey Telegram tutoring session today.
ትምህርቱ የሚሰጠው በ አማርኛ ነው🇪🇹
ዋጋው ተመጣጣኝ ነው።
ለመመዝገብ👇👇
@habesha_web_academy_bot
@habesha_web_academy_bot
@habesha_web_academy_bot
❤2🌚1
Ready to be come a web development wizard?
በዚህ ጊዜ በጣም ተፈላጊ የሆነውን ዌብ ዴቨሎፕመንት ( የዌብ ሳይት ግንባታ ) በአጭር ጊዜ ለመማር ከፈለጉ Habesha Web Academy ለእርስዎ ትክክለኛ ቦታ ነው። ልምድ ያላቸው አስጠኚዎች
HTML ✅
CSS ✅
BOOTSTRAP ✅
JAVA SCRIPT ✅
እና ሌሎችንም የድህረ ገፅ እውቀቶች 🌐 ያገኛሉ።
ሙሉ ለ ሙሉ ጀማሪ ከሆኑ ይሄ ትምህርት ለናንተ ነው። ይሄ tutor ችሎታችሁን ከተወዳዳሪ በላይ ለማድረግ ለምትፈልጉ ወሳኝ ነው።
ወደ ሀበሻ ዌብ አካዳሚ ዛሬውኑ በመዝገብ ትምህርት ይጀምሩ። ያለን ቦታ ውስን ስለሆነ ፈጥነው ይመዝገቡ።
ትምህርቱ የሚሰጠው በ አማርኛ ነው🇪🇹። ዋጋው ተመጣጣኝ ነው።
ለመመዝገብ👇👇
@habesha_web_academy_bot
@habesha_web_academy_bot
@habesha_web_academy_bot
በዚህ ጊዜ በጣም ተፈላጊ የሆነውን ዌብ ዴቨሎፕመንት ( የዌብ ሳይት ግንባታ ) በአጭር ጊዜ ለመማር ከፈለጉ Habesha Web Academy ለእርስዎ ትክክለኛ ቦታ ነው። ልምድ ያላቸው አስጠኚዎች
HTML ✅
CSS ✅
BOOTSTRAP ✅
JAVA SCRIPT ✅
እና ሌሎችንም የድህረ ገፅ እውቀቶች 🌐 ያገኛሉ።
ሙሉ ለ ሙሉ ጀማሪ ከሆኑ ይሄ ትምህርት ለናንተ ነው። ይሄ tutor ችሎታችሁን ከተወዳዳሪ በላይ ለማድረግ ለምትፈልጉ ወሳኝ ነው።
ወደ ሀበሻ ዌብ አካዳሚ ዛሬውኑ በመዝገብ ትምህርት ይጀምሩ። ያለን ቦታ ውስን ስለሆነ ፈጥነው ይመዝገቡ።
ትምህርቱ የሚሰጠው በ አማርኛ ነው🇪🇹። ዋጋው ተመጣጣኝ ነው።
ለመመዝገብ👇👇
@habesha_web_academy_bot
@habesha_web_academy_bot
@habesha_web_academy_bot
👍2
Our channel is specifically designed to keep you on the cutting edge of the latest airdrops and instant loot offerings.
Here's what you can expect from our channel:
1. Airdrops Galore
2. Instant Loot Opportunities
3. Timely Notifications
4. Comprehensive Information
5. Community Engagement
https://news.1rj.ru/str/cryptoaddictofficial1
Here's what you can expect from our channel:
1. Airdrops Galore
2. Instant Loot Opportunities
3. Timely Notifications
4. Comprehensive Information
5. Community Engagement
https://news.1rj.ru/str/cryptoaddictofficial1
👍2
Hey Python coders!
We apologize for the radio silence for the past few months. Life got a bit busy with.
But the good news is, we're BACK and itching to get coding with you again! We've got some awesome Python content planned, so stay tuned!
What coding challenges are you facing right now? Hit the comments and let us know!
We apologize for the radio silence for the past few months. Life got a bit busy with.
But the good news is, we're BACK and itching to get coding with you again! We've got some awesome Python content planned, so stay tuned!
What coding challenges are you facing right now? Hit the comments and let us know!
👍4
#binary_search Given a sorted array of integers (ascending order) and a target value, write a function to find the target's index in the array. If the target isn't found, return -1.
Constraints:
Use an algorithm with O(log n) time complexity.
Example:
Input: nums = [-1,0,3,5,9,12], target = 9
Output: 4
Can you solve it efficiently?
Constraints:
Use an algorithm with O(log n) time complexity.
Example:
Input: nums = [-1,0,3,5,9,12], target = 9
Output: 4
Can you solve it efficiently?
👍1
def binary_search(nums, target):
"""
Performs a binary search on a sorted array to find the index of a target value.
Args:
nums: A sorted list of integers (ascending order).
target: The integer value to search for.
Returns:
The index of the target in the list if found, otherwise -1.
"""
left, right = 0, len(nums) - 1
while left <= right:
# Find the middle index
middle = (left + right) // 2
# Check if the target is at the middle index
if nums[middle] == target:
return middle
# If the target is less than the middle element, search the left half
elif nums[middle] > target:
right = middle - 1
# If the target is greater than the middle element, search the right half
else:
left = middle + 1
# If the loop exits without finding the target, return -1
return -1
# Example usage
nums = [-1, 0, 3, 5, 9, 12]
target = 9
result = binary_search(nums, target)
if result != -1:
print(f"Target {target} found at index {result}")
else:
print(f"Target {target} not found in the list")
👍2
1The function binary_search takes a sorted array nums and a target value target as input.
2. It initializes two variables, left and right, which represent the left and right ends of the search interval, respectively. Initially, left is set to 0 and right is set to the length of the array minus 1.
3.The function enters a while loop that continues as long as left is less than or equal to right. This means that the search interval is still valid.
4.Inside the loop, the function calculates the middle index of the search interval using the formula middle = (left + right) // 2.
5.The function then checks if the target value is at the middle index of the array (nums[middle] == target).
6.If the target is found at the middle index, the function returns the middle index.
7.If the target is less than the value at the middle index (nums[middle] > target), it means that the target must be in the left half of the array. So the function updates the right pointer to middle - 1 to exclude the right half from the search interval.
8.If the target is greater than the value at the middle index (nums[middle] < target), it means that the target must be in the right half of the array. So the function updates the left pointer to middle + 1 to exclude the left half from the search interval.
If the loop exits without finding the target, it means that the target is not present in the array. The function returns -1 in this case.
2. It initializes two variables, left and right, which represent the left and right ends of the search interval, respectively. Initially, left is set to 0 and right is set to the length of the array minus 1.
3.The function enters a while loop that continues as long as left is less than or equal to right. This means that the search interval is still valid.
4.Inside the loop, the function calculates the middle index of the search interval using the formula middle = (left + right) // 2.
5.The function then checks if the target value is at the middle index of the array (nums[middle] == target).
6.If the target is found at the middle index, the function returns the middle index.
7.If the target is less than the value at the middle index (nums[middle] > target), it means that the target must be in the left half of the array. So the function updates the right pointer to middle - 1 to exclude the right half from the search interval.
8.If the target is greater than the value at the middle index (nums[middle] < target), it means that the target must be in the right half of the array. So the function updates the left pointer to middle + 1 to exclude the left half from the search interval.
If the loop exits without finding the target, it means that the target is not present in the array. The function returns -1 in this case.
Question 2 on #binary_search Binary Search: Treasure Hunt!
Imagine searching for buried treasure on a coastline. You have distances to the treasure from various points (sorted from smallest to biggest).
Binary search helps find the closest distance to the treasure from your ship's location. It works by repeatedly guessing the middle distance and checking if it's the treasure or closer than your acceptable range (tolerance).
It's super fast for sorted lists (like your treasure distances).
Think of eliminating half the coastline on each guess!
Example:
Ship at distance 50 meters. Tolerance 10 meters.
Distances: [10, 20, 40, 60, 80]
Binary search would check:
Middle distance (40 meters) - too far, but closer than 60 meters!
Left half (now 10, 20, 40) - Bingo! 40 meters is closest within tolerance.
Imagine searching for buried treasure on a coastline. You have distances to the treasure from various points (sorted from smallest to biggest).
Binary search helps find the closest distance to the treasure from your ship's location. It works by repeatedly guessing the middle distance and checking if it's the treasure or closer than your acceptable range (tolerance).
It's super fast for sorted lists (like your treasure distances).
Think of eliminating half the coastline on each guess!
Example:
Ship at distance 50 meters. Tolerance 10 meters.
Distances: [10, 20, 40, 60, 80]
Binary search would check:
Middle distance (40 meters) - too far, but closer than 60 meters!
Left half (now 10, 20, 40) - Bingo! 40 meters is closest within tolerance.
What is the output of the following code?
```
number = 5 number = number * 2 print(number)```
```
number = 5 number = number * 2 print(number)```
Anonymous Quiz
6%
A) 5
62%
B) 10
28%
C) An error
4%
D)2
What does the following code snippet do?
Python
my_list = [1, 2, 3, 4] print(my_list[1])
Python
my_list = [1, 2, 3, 4] print(my_list[1])
Anonymous Quiz
27%
1
66%
2
2%
3
5%
4
Forwarded from Leetcode with dani
6. What is the output of the following code?
X = 3 y = 5 z = x if x < y: print(z)
X = 3 y = 5 z = x if x < y: print(z)
Anonymous Quiz
75%
A. 3
5%
B. 5
19%
C. x
1%
D. y
Forwarded from Leetcode with dani
4. Which of the following is NOT a valid data type in Python?
Anonymous Quiz
6%
int
4%
float
75%
variable
15%
boolean