https://github.com/hananemirzaee/python-challenges1
Python challenges for beginners.
https://github.com/hananemirzaee/python-challenges1
challenges if-else operating-system python while-loop
Last synced: 5 months ago
JSON representation
Python challenges for beginners.
- Host: GitHub
- URL: https://github.com/hananemirzaee/python-challenges1
- Owner: hananemirzaee
- Created: 2025-04-28T14:19:02.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-04-28T14:39:38.000Z (5 months ago)
- Last Synced: 2025-04-28T15:36:17.960Z (5 months ago)
- Topics: challenges, if-else, operating-system, python, while-loop
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python challenges
### Questions:
**Question 1: Data Types**
Create variables to store your name, age, and whether you are a student.
Write a program that prints each variable along with its data type.---
**Question 2: Type Conversion**
Write a program that asks the user to enter a number (as a string).
Convert it to an integer and then print the square of the number.---
**Question 3: Conditions**
Write a program that asks the user to input a number.
Check whether the number is positive, negative, or zero, and print the result.---
**Question 4: Logical Operations**
Write a program that asks the user for their age.
Check if the age is between 18 and 30 (inclusive).
If true, print "You are in your twenties!", otherwise print "You are not in your twenties."---
**Question 5: Mathematical Operations**
Write a program that asks the user to input two numbers.
Perform addition, subtraction, multiplication, and division on these numbers and print the results.---
**Question 6: if-elif-else**
Write a program that takes the current temperature as input.
- If the temperature is below 0, print "Freezing."
- If it's between 0 and 25, print "Cold."
- If it's between 26 and 35, print "Warm."
- If it's above 35, print "Hot."---
**Question 7: while Loop**
Write a program that prints numbers from 1 to 10 using a `while` loop.---
**Question 8: for Loop**
Write a program that prints all elements of the list `[10, 20, 30, 40, 50]` using a `for` loop.---
**Question 9: Conditions with Loops**
Write a program that takes an integer input.
- If the number is even, print all even numbers from 0 up to that number using a `for` loop.
- If the number is odd, print all odd numbers from 0 up to that number.---
**Question 10: Factorial with Loops**
Write a program that takes a number as input and calculates its factorial using a `while` loop.