top of page

What is While-Loop Statements ? | Programming and Data Structures Assignment Help | Realcode4you

The first while-loop example

 for i in range(0,10): 
	print(i)
ree
ree

Going backwards

ree
ree

 Times table example

for i in range(1,10): 
	print("{0} x {1} = {2}".format(i, 5, 5*i))
ree
ree

Friend of 10 table

for i in range(0,11): 
	print("{0:>2} + {1:>2} = {2:>2}".format(i, 10 - i, 10))
ree
ree


Questions

What is the output of the following codes?

ree
ree
ree

Display equations


Enter start number: 4

Enter end number: 7


Equations:

4 + 4 = 8

5 + 5 = 10

6 + 6 = 12

7 + 7 = 14


# ask user for start number

# ask user for end number

# display equations between the two input numbers


ree

while loop that runs forever

while True: 
	user_input = input("Enter something: ") 
	print("You have entered: " + user_input)

This program will run forever!

ree

this while loop will stop if user enters q

ree
ree

Keep asking until user enters a positive number

ree
ree

Counting even and odd numbers

ree

ree

Green egg and ham?

ree
ree

Green egg and ham?

ree

Comments


REALCODE4YOU

Realcode4you is the one of the best website where you can get all computer science and mathematics related help, we are offering python project help, java project help, Machine learning project help, and other programming language help i.e., C, C++, Data Structure, PHP, ReactJs, NodeJs, React Native and also providing all databases related help.

Hire Us to get Instant help from realcode4you expert with an affordable price.

USEFUL LINKS

Discount

ADDRESS

Noida, Sector 63, India 201301

Follows Us!

  • Facebook
  • Twitter
  • Instagram
  • LinkedIn

OUR CLIENTS BELONGS TO

  • india
  • australia
  • canada
  • hong-kong
  • ireland
  • jordan
  • malaysia
  • new-zealand
  • oman
  • qatar
  • saudi-arabia
  • singapore
  • south-africa
  • uae
  • uk
  • usa

© 2023 IT Services provided by Realcode4you.com

bottom of page