Forum in maintenance, we will back soon 🙂
Notifications
Clear all
Homework Loops
Share your Prompts & Tests
2
Posts
2
Users
3
Reactions
61
Views
Topic starter
First I just asked verbally and ChatGPT gave me this answer:
```python
for num in range(1, 11)
if num % 2 != 0:
print(num)
else:
print("Even number detected!")
I tried it and it worked.
Then I copy/pasted your "hint" and it gave me this answer:
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for number in numbers:
if number % 2 != 0:
print(number)
else:
print("Even number detected!")
I see I can write "for num in range(1, 11)" (vs typing out each number)
ChatGPT does in a blink what I would have struggled with for hours maybe.
It's like alien intelligence willing to answer my questions.
Posted : 07/01/2023 5:04 am
SSAdvisor and Hasan Aboul Hasan reacted
The most important thing here it to understand the output. And don't just reply on chatgpt.
Posted : 07/01/2023 7:48 pm
SSAdvisor reacted
Forum Information
Our newest member: Shaik Abdul Raheem
Latest Post: Affiliate tool.
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed
[the_ad_group id="312"]