473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

I want to run the entire program n times if it is a sameuser else need to exit

I will take care thanks
Sep 11 '13 #1
2 1388
i have trouble how to loop back to the top from the first incase it has same user else need to exit

Works fine until while sameuser == 'Yes'
But not sure how to get back to the top of the program if it is a YES
Please help
Sep 11 '13 #2
dwblas
626 Expert 512MB
A while loop solves the problem
Expand|Select|Wrap|Line Numbers
  1. def print_user(user):
  2.     """ put code you want to execute here
  3.     """
  4.     print user
  5.  
  6. orig_user = raw_input("Enter user name ")
  7. user = orig_user
  8. while user == orig_user:
  9.     print_user(user)
  10.     user = raw_input("Enter user name ") 
Sep 12 '13 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: anismo | last post by:
Hi, I have an application that uses a couple of shared libraries and this application forks to become a daemon. But when the parent after the fork calls exit(0), I am getting a coredump . Upon...
1
by: Tim | last post by:
I have successfully captured the scroll event of the listview control by creating a class that inherits the list view control then overriding the wndproc procedure. I have two questions though....
3
by: rojavenkat81 | last post by:
Hi All, Please help me regarding php program for convert video file to .flv file. I searched in many sites but i got only tool to convert video file to .flv file.But I want convert...
4
Hunderpanzer
by: Hunderpanzer | last post by:
I'm trying to learn a little by looking at source codes from free downloaded programs. There's a bunch of .cpp files and .h files, but I'm not sure of how to compile all the files into one .exe so...
8
by: Nirav Amin | last post by:
Create a 2-D array containing the data : Pakistan Sweden France Iran China Japan Russia China Italy China China ...
8
by: ImortalSorrow | last post by:
Hey, I'm quite new in programing so need some help with this lottery program I'm making. What I'm trying to do is very simple, simulate a lottery but my effords are in vain since when I'm compiling...
2
dwhs
by: dwhs | last post by:
Not sure how to say this, there is a sizer on the top right of my page if you mouse over it here my site I really want to get rid of it. Anything to help the page load smoother, it is using major...
1
by: aby242002 | last post by:
I want to identify the an amount is grater than A amount same time want to calculate other percentage if that is less than A amount
3
by: Colt | last post by:
I have this program that an associate will input their ID# then it prints back saying (your associate ID# is XXX) then it will state what time it they clocked in/out--Ex: Your ID# is 101 and you left...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.