Python Basics
"You cannot be great at the start, but you have to start to be great. So, making a beginning is important. In this list of questions, get your feet wet,before beginning a more arduous Python journey"
— All the best
- Print your favorite animal's name.
- Print a message saying "I love Python programming!".
- Print three separate sentences about your favorite hobby, each on a new line.
- Print a short story using triple quotes that includes at least two paragraphs.
- Write a program that prints the message, "Success is achieved twice, first in your brain then in the real world".
- Write a program that prints the following four lines using a single
print
function and only double quotes (" "). - Write a program that prints the following direct statement using a single
print
function and only double quotes (" "). - Print a the following message using a single
print
function and only triple quotes (''' '''). - Print a the following message using a single
print
function and only double quotes (""). No loops has to be used. - Write a program that prints a name 5 times vertically, with one name per line. Don't use loops.
- Write a program that prints a name 5 times horizontally on a single line. Don't use loops.
- Write a program that prints the title
Elvin's book
using a singleprint
statement and single inverted commas (' '). - Print the following pattern using format function within the print function:
- Print the following pattern using format function within the print function:
- Print a short poem you like, ensuring each line is on a new line.
- Print a description of your dream vacation using both single and double quotes.
- Print a message that uses emojis or special characters (like ♥️ or 😊) to express an emotion or idea.
- Declare a variable to store a number. Print the value of the variable.
- Declare a variable called
helpline_number
to store the national emergency number of your country and print the message: "In any emergency, contact [helpline_number]." - Declare a variable to store the name of a country and a second variable called
helpline_number
to store the national emergency number. Print the message: "In any emergency in [country name], contact [helpline_number]." - Declare a variable to store a first number and a second variable to store a second number. Declare a third variable to store their sum and print it.
- Declare a variable to store a first number and a second variable to store a second number. Declare four extra variables to store the sum, difference, product, and division of the two numbers and print them.
- Assign the value "25" to a variable called
age
and print the message: "I am 25 years old." - Assign the values "25" and "Engineering" to variables
age
andmajor
, respectively. Print the message: "I am 25 years old and studying Engineering." - Declare a variable
city
with the value "New York" and print the message: "I live in \'New York.\'" - Create three variables,
city
,state
, andcountry
, with the values "New York", "NY", and "USA", respectively. Print the message: "I live in New York, NY, USA." - Declare two variables,
price
anddiscount
, with the values "100" and "20", respectively. Then, calculate and print the discounted price (price - discount). - Create three variables,
num1
,num2
, andnum3
, with the values "10", "20", and "30", respectively. Calculate and print the average of the three numbers. - Declare a variable
x
with the value "5". Then, calculate and print the value ofx
squared (x^2
). - Assign the value "10" to a variable
y
. Then, calculate and print the value ofy
multiplied by 3. - Create a variable
z
with the value "2". Then, calculate and print the value ofz
cubed (z^3
). - Create three variables,
e
,f
, andg
, with the values "2", "3", and "4", respectively. Then, calculate and print the value ofe
multiplied byf
plusg
. - Write the Python expression for the following:
1.
2.
3.
4.
5.
6.
7.
8.
9.
For example, the output should look like this:
"Success is achieved twice, first in your brain then in the real world"
For example, the output should look like this:
What is this life if, full of care, we have no time to stand and stare. No time to stand beneath the boughs and stare as long as sheep or cows.
For example, the output should look like this:
She said to me,"I want to learn Python."


For example, if the name is
John
, the output should look like this:
John John John John John
For example, if the name is
John
, the output should look like this:
John John John John John
For example, the output should look like this:
'Elvin's book'